mysql语句中添加php变量
YouhaveanerrorinyourSQLsyntax;checkthemanualthatcorrespondstoyourMySQLserverversionfo...
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 '".$page.",2' at line 1
SELECT Id, state, totalName, property, startTime, amountIn, amountOut, balanceIn, balanceOut FROM contract LIMIT ".$page.",2
以上是问题描述
那句代码是$query = $this->db->query('SELECT Id, state, totalName, property, startTime, amountIn, amountOut, balanceIn, balanceOut FROM contract LIMIT ".$page.",2'); 展开
SELECT Id, state, totalName, property, startTime, amountIn, amountOut, balanceIn, balanceOut FROM contract LIMIT ".$page.",2
以上是问题描述
那句代码是$query = $this->db->query('SELECT Id, state, totalName, property, startTime, amountIn, amountOut, balanceIn, balanceOut FROM contract LIMIT ".$page.",2'); 展开
展开全部
一看就是标点符号加错了,试试下面这句
$query = $this->db->query('SELECT Id, state, totalName, property, startTime, amountIn, amountOut, balanceIn, balanceOut FROM contract LIMIT '.$page.',2');
或者
$query = $this->db->query("SELECT Id, state, totalName, property, startTime, amountIn, amountOut, balanceIn, balanceOut FROM contract LIMIT $page,2");
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询