mysql_num_rows返回0,但SQL返回正常值

时间:2015-03-15 13:51:49

标签: php mysql sql mysql-num-rows

$getPrd = mysql_query("SELECT * FROM products
LEFT OUTER JOIN productscontent ON productscontent.productsID = products.id
WHERE productscontent.title LIKE '%".$search."%' OR productscontent.alltext LIKE '%".$search."%'
ORDER BY products.sortnr");

$num = mysql_num_rows($getPrd);

$getPrd会根据需要返回值,但$num会返回0 - 为什么会这样?

0 个答案:

没有答案