Wednesday, September 18, 2013

mysql_fetch_row not working

mysql_fetch_row not working

I have a function which queries database and counts the number of rows in it.
if($action=='shipping_list'){
$row;
$shipping=shipping_list();
$numrow=$r[0];
$row=mysql_fetch_row($paging);
include('shipping_list.php');}
function shipping_list(){
global $MEMS;
global $row;
$query = "SELECT * FROM Inventory
WHERE Yield >=330 AND (Q = 'Pass' OR Q = 'No Q') AND shipdate = ' '
ORDER BY Wafer ASC, RC ASC";
$shipping = $MEMS -> query($query);
$query = "SELECT COUNT(*) Inventory
WHERE Yield >=330 AND (Q = 'Pass' OR Q = 'No Q') AND shipdate = ' '";
$paging = $MEMS -> query($query);
return $shipping;
}
Basically, it calls on the function, which has a SQL command that counts
the number of queries returned. The code then fetches the row with mysql
fetch row. However, $row keep returning NULL. Does anyone here know what
I'm doing wrong?

No comments:

Post a Comment