Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - Good * old fashioned `annoying` SQL `question`('s'); | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
windwaker

Ball and Chain Trooper
WHY ALL THE MAYONNAISE HATE
Level: 61

Posts: 467/1797
EXP: 1860597
For next: 15999

Since: 03-15-04

Since last post: 4 days
Last activity: 6 days
Posted on 11-27-04 11:12 AM Link | Quote
Yes, lame title .

Here's something I've been looking for for a while and I haven't been able to find the answer .

When I fetch an array into a variable (let's say $omg), and I want to select a column, I go $omg[columnname]. Is there a way in which I can select a row like this, too? Like (doubt this works), but something like $omg[[row][column]]?
SyntaxLegend

Double metal axe
Level: 25

Posts: 109/222
EXP: 78264
For next: 11356

Since: 04-21-04
From: Australia

Since last post: 20 days
Last activity: 10 hours
Posted on 11-27-04 01:14 PM Link | Quote
actually i think its exactly like that, or the other way around.. but looking in the acmlmboard code. It seems to use that alot. So yeah..
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 180/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 11-27-04 01:49 PM Link | Quote
You could write something like:

$res = mysql_query("SELECT * FROM footable");
$rows = 0;
while ($omg[$rows] = mysql_fetch_array($res)) {
$rows++;
}
mysql_free_result($res);


Then use $omg[row][column] to access data. The $rows varible will hold the total number or rows.

You may want to see http://www.php.net/manual/en/language.types.array.php#language.types.array.foo-bar.
windwaker

Ball and Chain Trooper
WHY ALL THE MAYONNAISE HATE
Level: 61

Posts: 468/1797
EXP: 1860597
For next: 15999

Since: 03-15-04

Since last post: 4 days
Last activity: 6 days
Posted on 11-28-04 05:36 AM Link | Quote


Wow, I didn't know that I was right XD.

Thanks.

Oooh, and thanks for the script; I needed to develop one like that anyway .


(edited by windwaker on 11-27-04 08:37 PM)
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Programming - Good * old fashioned `annoying` SQL `question`('s'); | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.006 seconds.