$page_dr=1;
$page_size=12;
$sql='select * from pro_sell limit :start,:num';
$bindparams=array(':start'=>$page_dr-1,':num'=>$page_size);
$result=$handler->execSql($sql,$bindparams,"selectAll");报错如下
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 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 ''0','12'' at line 1
$page_size=12;
$sql='select * from pro_sell limit :start,:num';
$bindparams=array(':start'=>$page_dr-1,':num'=>$page_size);
$result=$handler->execSql($sql,$bindparams,"selectAll");报错如下
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 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 ''0','12'' at line 1
我这个是没有引号的,是不是这个参数类型sql识别为字符串
要这样写,不能使用占位符
$page_dr=1;
$page_size=12;
$sql='select * from pro_sell limit '.($page_dr-1).','.$pagesize;
$bindparams=array();
$result=$handler->execSql($sql,$bindparams,"selectAll");
http://blog.csdn.net/jinbiao520/article/details/7469264
要这样写,不能使用占位符
$page_dr=1;
$page_size=12;
$sql='select * from pro_sell limit '.($page_dr-1).','.$pagesize;
$bindparams=array();
$result=$handler->execSql($sql,$bindparams,"selectAll");