Page 1 of 1

Problem Querying Multiple Rows

Posted: Wed Dec 26, 2012 3:15 pm
by nbasso713
All I'm trying to do is create an array with all the id's that have a value of 0 in the status column of the table.

Code: Select all

$query = mysql_query("SELECT `tempID` FROM `pending` WHERE `status` = 0");
$status = mysql_fetch_array($query);
This codes has only been returning a single row any ideas?

Re: Problem Querying Multiple Rows

Posted: Wed Dec 26, 2012 4:04 pm
by nbasso713
SOLVED

Created a while loop

Code: Select all

while ($row = mysql_fetch_array($query, MYSQL_NUM)) {
     $status[$i] =  $row[0];
     $i++;
}