I'm running into a situation where a mysql_query() result being fed into a mysql_fetch_array() function is being interpreted as a boolean instead of the result.
The below code uses Using an SQL result in a foreach loop as a coding example for doing a foreach loop. There may be multiple problems with the code still as my current problem occurs before the foreach loop.
$results=mysql_query("SELECT * FROM order_details WHERE orderid = $orderid");
print "SELECT * FROM order_details WHERE orderid = $orderid";
$productid;
$quantity;
$price;
$resultset = array();
while ($row = mysql_fetch_arraY($results)) {
$resultset[] = $row;
}
foreach ($resultset as $result)
{
$productid = $result['productid'];
$quantity = $result['quantity'];
$price = $result['price'];
print "<br />$productid, $quantity, $price";
};