Re: [PHP-DB] numeric string to single digit array

[email protected] (Evert Lammerts)
Newsgroups php.db
Message-ID <[email protected]>
> 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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.