I have the following query:
$stmt = $this->db_con->prepare(
SELECT u.fname, u.lname, u.username from repair_dealer d
WHERE d.user_id=:u_id
ORDER BY d.date_added DESC
LIMIT :pageIndex, :pageSize
)
$stmt->bindValue(':u_id', $user_id, PDO::PARAM_INT);
$stmt->bindValue(':pageIndex', $pageIndex, PARAM_INT);
$stmt->bindValue(':pageSize', $pageSize, PARAM_INT);
$stmt->execute();
The values are sent from ionic as numbers, but I am having the following php-sql error at the console:
message: "ERROR : 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', '15'' at line 16"
0 and 15 are the limits
I tested out this query on my server and it returned data.