自 PHP 4.0.6 起不提倡使用此函数。不要用此函数,用 mysql_select_db() 和 mysql_query() 来替代。
---------------------------------------------
"echo $result结果为:select * from news where category='热点' order by date desc "$result的值只是一个字符串,你要用mysql_num_rows()能得出什么?
------------------------------
$result的结果应该是个结果集,才能出到你想要的东西。
---------------------------------------------
"echo $result结果为:select * from news where category='热点' order by date desc "$result的值只是一个字符串,你要用mysql_num_rows()能得出什么?
------------------------------
$result的结果应该是个结果集,才能出到你想要的东西。
<?php$link = mysql_connect("localhost", "mysql_user", "mysql_password");
mysql_select_db("database", $link);$result = mysql_query("SELECT * FROM table1", $link);
$num_rows = mysql_num_rows($result);echo "$num_rows Rows\n";?>
Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '=' 这是不是什么中文和什么拉丁文什么的不合法呢?求救
如果还不行,可能就要重新装一下mysql了
mysql_query("SET NAMES gbk");
就OK了!~~