I’m receiving this error:
[code=php]Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource
on the second to last line of this code:
[code=php]$sql = “SELECT l.id lid, l.have, l.qty, if (v.price !=”, v.price, p.price) price, p.name, if (v.sku !=”, v.sku, p.sku) sku, p.id, l.vid, v.name var
FROM list_items l, inv_products p
LEFT JOIN inv_variations v ON v.vid = l.vid AND v.product = l.product
WHERE list=”${_GET[‘id’]}” AND p.id = l.product”;
$r = mysql_query($sql);
while ($p = mysql_fetch_object($r)) {
$i = $i ? 0 : 1;
?>
When I turn on error detection, I get a T_ENCAPSED_AND_WHITESPACE error.
This code seemed to be working fine before we migrated to a new server a few weeks ago. Our old server was running an outdated version of PHP (4.x?) and I think maybe that’s the cause here. Perhaps some bad syntax that I’m just having no luck finding? Any suggestions are appreciated!
Jack