> I have a database, all the data is numbers. I want to make a query that
> will extract the data and then make it available in an array, so the
> array is populated 'real-time'. I could just enter the number into an
> array manually, but I want to automate the job. I don't know what to
> start looking for, the 3 books I have either don't talk about this or I
> just am missing it.
> Could someone point me in the right direction?

Well after you SELECT the data and run the query, you can use a few
functions, it depends on your database type?

For example, for MySQL, you can use mysql_fetch_array() which will take your
data and store it in an array, both numeric and associative.

i.e. $data = mysql_fetch_array($result) can be accessed like


You can also fetch an array only as an associative (mysql_fetch_assoc) or
numeric (mysql_fetch_row). And simply if selecting multiple rows, use a loop

while($data = mysql_fetch_array())...

Adam Alkins

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to