var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: PDO, Limit and BindParam
... Using MySQL 5 and PHP 5.2.3
For the life of me I can't get the above to work and after an hour i still have no clue why. That query works fine if i manually code the limit in, or if i place the
$stmt = $dbh->prepare('SELECT advert_title,advert_body from Ads WHERE isFeatured=1 Limit 1,:offset');
ffset placeholder anywhere else...
Error returned by $stmt->errorInfo(): 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 ''1'' at line 1
... I'm guessing thats because its trying to pass a string in when it probably shouldn't be.
The purpose of the query is to return the nth advert in a list of featured ad's.
Anyone have any ideas?
Last edited by Genx; 12-12-07 at
Well, nothing I tried works, so it seems that i'll just have to feed this particular variable directly into the sql statement using something like intval($_GET['foo']) given that it will always be an int anyway.