Pagination 's bug |
[eluser]tottyandbaty[/eluser]
Code: $CI =& get_instance(); is_numeric(1.)//return true if you enter http://locahost/blog/somefunction/1. it will return some error message
[eluser]tottyandbaty[/eluser]
see :http://www.windy020.com/index.php/life/index/0/11. it will return : A Database Error Occurred Error Number: 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 '11., 11' at line 4 SELECT * FROM (`life`) ORDER BY `time` desc LIMIT 11., 11
[eluser]Thorpe Obazee[/eluser]
Judging from your URL AND/OR your SQL statement, I think there's a problem with your code.
[eluser]tottyandbaty[/eluser]
首先 ,我的代码不存在任何问题。 通常情况下,正常显示的URL为: http://www.windy020.com/index.php/life/index/0/11 那么这个时候$SQL="SELECT * FROM (`life`) ORDER BY `time` desc LIMIT 11,11 "; 显示很正常 。 但是 如果我在在地址栏这么写 : http://www.windy020.com/index.php/life/index/0/11. 最后面包含一个 “.” 很明显这个时候SQL出现语法错误! 在分页类中 使用is_numeric来判断 是否为整数 ,但是is_numeric(1.)会返回 true
[eluser]Thorpe Obazee[/eluser]
You should probably look into this: http://ellislab.com/forums/viewthread/121302/#601031 |
Welcome Guest, Not a member yet? Register Sign In |