-2

Im just trying for pagination in one of my project and I am getting an error like this

Fatal error: Uncaught PDOException: 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',5' at line 1

Please Help me..

Zohar Peled
  • 79,642
  • 10
  • 69
  • 121

1 Answers1

0

You get this error because $go parameter is being inserted as string rather than int. I recommend to bind parameters before execute. You can do it like this:

$stmt->bindParam(':go', $go, PDO::PARAM_INT);
Alex
  • 187
  • 4