Page 1 of 1

Unknown column 'a' ??

Posted: Wed Jul 28, 2004 5:43 am
by C_Calav
hi guys,

been solving alot of errors with this "or die(mysql_error()" been great, but ive run into this:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /var/users/modelair/modelaircraft.co.nz/htdocs/cart.php on line 54
Unknown column 'a' in 'where clause'

what does this mean? i dont have anything refering to a column a?

thanx


Code: Select all

<?php

      $result = mysql_query("SELECT count(*) FROM cart WHERE cookieId = '" . GetCartId() . "' AND P_Stock = $P_Stock"); 
      $row = mysql_fetch_row($result) or die(mysql_error()); 
      $numRows = $row[0]; 
?>

Posted: Wed Jul 28, 2004 6:03 am
by feyd
is $P_Stock non-numeric? if so, put single quotes around it. Either way, you have an error in your sql probably