So I have this
$sql_totalbooknumber = "SELECT SUM(items_counter) FROM probid_categories WHERE items_counter>0 AND `category_id <>355";
$sql_updatebooknumber = "UPDATE `probid_categories` SET `items_counter` = ".$sql_totalbooknumber." WHERE `category_id` = '355'";
if (!mysql_query($sql_totalbooknumber))
{
die('Error: ' . mysql_error());
};
if (!mysql_query($sql_updatebooknumber))
{
die('Error: ' . mysql_error());
};
somehow they work fine individually (if i comment out one or the other) but when I combine them I get this error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT SUM(items_counter) FROM probid_categories WHERE items_counter>0 AND `cate' at line 1