我有这个简单的PHP代码:
$query = mysql_query("SELECT `title`, `url_title` FROM `fastsearch` WHERE `tags` LIKE '%$q%' LIMIT 5"); $query2 = mysql_fetch_assoc($quer); print_r($query2);
它仅返回以下内容:
Array ( [title] => Kill Bill Vol 1. [url_title] => kill_bill_vol_1 )
我的表中有3500多行,并且在PhpMyAdmin中运行SQL效果很好。
$query = mysql_query("SELECT `title`, `url_title` FROM `fastsearch` WHERE `tags` LIKE '%$q%' LIMIT 5"); while ($row = mysql_fetch_assoc($query)) { print_r($row); }
$query
mysql_fetch_assoc()
FALSE
while()
$row