I am trying to fix a query in codeigniter, by binding queries for safety. But I am unable to use "?" in the limit parameter of the sql query.
Without using codeigntier's query builder, how can I fix this problem and still enable the queries to be escaped/safe?
My CODE
$query = " SELECT * FROM users ORDER BY uid DESC LIMIT ?, ? ";
$bind = array($one, $two)
$query = $this->db->query($query, $bind);
The error I get is below
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?, ?' at line 1
Thanks
Hope this will help you :
Remove
$idfrom your$bind, since u r not using it anywhere in your$queryFor more : https://www.codeigniter.com/user_guide/database/queries.html#query-bindings