这是我的代码:
if (!$connect){
die("Failed to connect to the database: ".mysql_error());
}
$kies_bd = mysql_select_db("eraenz_db1",$connect);
if (!$kies_bd){
die("failed to choose from BD: ".mysql_error());
}
$query = mysql_query("SELECT ListNumber FROM residential");// or die($myQuery."<br/><br/>".mysql_error());
$result1 = mysql_fetch_assoc($query) or die($myQuery."<br/><br/>".mysql_error());
echo $result1;
if (mysql_num_rows($result1) >10){
$difference = mysql_num_rows($result1) - 10;
$myQuery = mysql_query("SELECT * FROM residential ORDER BY ListNumber LIMIT 10,". $difference) ;
答案 0 :(得分:3)
mysql_num_rows函数接受资源标识符
在你的情况下它是$query
注意$result1
是获取的数组,包含不应该在此函数中传递的数据库中的数据。
mysql_num_rows($query)
我建议你在询问问题之前阅读manual