I've been tearing my eyes out this morning trying to get this to work. The query is working fine and I've checked to see that it's returning rows. The problem has to do with the $row = fetch... line, or at least I think that's what it is. There may be some issues with what is actually printed. I'm not so worried about that right now. I can figure that out once I'm able to actually be able to use the query results. Any ideas?
require_once('includes/mysql_connect.php');
$query= "SELECT item_name, price, shipping, item_id
FROM item
WHERE item_id IN(";
foreach($_SESSION['cart'] as $pid => $value)
{
$query .= $pid . ',';
}
$query = substr($query, 0, -1) . ')
ORDER BY item_name ASC';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$num = mysql_num_rows($result);
$total = 0;
while($row = mysql_fetch_array($result));
{
$subtotal = $_SESSION['cart'][$row['item_id']]['quantity'] * ($_SESSION['cart'][$row['item_id']]['price'] + $_SESSION['cart'][$row['item_id']]['shipping']);
$total += $subtotal;
echo "<tr>\n
<td valign=\"top\">{$row['item_name']}</td>\n
<td valign=\"top\">{$row['price']}</td>\n
<td valign=\"top\">{$row['shipping']}</td>\n
<td valign=\"top\"><input type=\"text\" size=\"3\" name=\"qty[{$row['item_id']}]\" value=\"{$_SESSION['cart'][$row['item_id']]['quantity']}\" /></td>\n
<td valign=\"top\">$subtotal</td>\n
</tr>\n";
}
Thanks!