Welcome Guest, Not a member yet? Register   Sign In
syntax error
#1

[eluser]basicstudent[/eluser]
#2

[eluser]WanWizard[/eluser]
How to fix what?
#3

[eluser]basicstudent[/eluser]
#4

[eluser]WanWizard[/eluser]
Then start by showing us some queries, this code doesn't contain any. How can we help if we don't know the error, and don't know the code?

If you have a syntax error, it shows you the query that failed, and what is wrong with it. So find the query (in your model?), and fix it?
#5

[eluser]basicstudent[/eluser]
Quote:
#6

[eluser]mi6crazyheart[/eluser]
Can u show us your MODEL codes from where u r making those query... ?
#7

[eluser]basicstudent[/eluser]
#8

[eluser]WanWizard[/eluser]
That is not really a solution.

The query() method is used for hand-coded queries, which, unless you screened your parameters very carefully and properly escaped them all, just increased the chance on a sql injection.

Find the fault, and fix it. You still haven't shown us the code, or the query.

My educated guess is when $page = 0, your row indicator becomes negative (the -5). So it's a logic error you need to fix.
#9

[eluser]basicstudent[/eluser]
#10

[eluser]WanWizard[/eluser]
As I wrote earlier, if $page is zero,
Code:
$max = array($page_rows,($page - 1) * $page_rows);
will create an array
Code:
$max = array(5, -5);

Which in the model will be converted to
Code:
$this->db->limit(5, -5);

Which will cause a syntax error, limits may not be negative.




Theme © iAndrew 2016 - Forum software by © MyBB