Passing database values into an array
Posted: Sun Mar 12, 2006 6:34 am
I would like to run a query on a databse and then pass the values into an array...
Ive written the code to get the values i need:
which i can use to print out all the results. I want to put the results into an array now, but not sure how to do so.
Please help!
Thanks
Ive written the code to get the values i need:
Code: Select all
$firstquery = "SELECT this
FROM thatTable" or die ("Unable to...");
$result = mysql_query($firstquery, $dblink);
$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
$values = mysql_result($result,$i,"valuesiwant");
$i++;
}
mysql_close();Please help!
Thanks