<?php
require"uap.php";
if(isset($_GET["page"]))
$page=intval($_GET["page"]);
else
$page=1;
$link = mysql_connect($db_host,$db_username,$db_password);
if (!$link) {
die('Could not connect to MySQL: ' . mysql_error());
}
$sql="select id from $table_name";
$result=mysql_query($sql,$link);
$num=mysql_num_rows($result);为什么会报
( ! ) Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\insert.php on line 13
这样的错,求解释,谢谢
require"uap.php";
if(isset($_GET["page"]))
$page=intval($_GET["page"]);
else
$page=1;
$link = mysql_connect($db_host,$db_username,$db_password);
if (!$link) {
die('Could not connect to MySQL: ' . mysql_error());
}
$sql="select id from $table_name";
$result=mysql_query($sql,$link);
$num=mysql_num_rows($result);为什么会报
( ! ) Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\insert.php on line 13
这样的错,求解释,谢谢
而且数据库经检验也连接上了
<?php
$temp=($page-1)*$list_num;
mysql_select_db($db_name,$link);
$sql="select*from$table_name limit $temp,$list_num";
$result=mysql_query($sql,$link) or die(mysql_error());
while($row=mysql_fetch_array($result))
{
这一段还是Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\insert.php on line 47
这样的错误
加上die(mysql.error())之后是
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'frominfo limit 0,10' at line 1
应该说你这句空格都漏了!$sql="select * from $table_name limit $temp,$list_num";