Re: numeric string to single digit array

From: Date: Wed, 26 Mar 2008 18:26:44 +0000
Subject: Re: numeric string to single digit array
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-44815@lists.php.net to get a copy of this message
The semi-colon is gone, although I didn't even notice it! I am using two different queries, one for count and the other to access the data itself. After running mysql_fetch_assoc, is foreach ok for accessing array members, or is there a more subtle approach? So it's working now? If it is, you won't need to do a separate COUNT() query... you could use either a count / sizeof after fetching all the data, or a mysql_num_rows call.
Foreach'll work fine, but in general I access the array's members by their associated column name's. If you don't need the column names as keys you can use mysql_fetch_row instead of mysql_fetch_assoc.

« previous php.db (#44815) next »