我该如何正确地写这个?
$sql_totalbooknumber = "SELECT SUM(items_counter) FROM probid_categories WHERE items_counter>0 AND `category_id` <>355";
我明白了
您的SQL语法有错误;检查与MySQL服务器版本对应的手册,以便在'SELECT SUM(items_counter)FROM probid_categories WHERE items_counter&gt; 0和'cate'在第1行附近使用正确的语法
if (!mysql_query($sql_totalbooknumber))
{
die('Error: ' . mysql_error());
};
答案 0 :(得分:-1)
尝试
$sql_totalbooknumber = "SELECT SUM(items_counter) FROM probid_categories WHERE items_counter>0 AND category_id != 355"
;