RobertP Posted June 1, 2012 Share Posted June 1, 2012 $connection->exec('update plugin_advertisements set out = out+1 where id = '.intval($id).';'); $connection->execute('update plugin_advertisements set out = out+1 where id = ?;',array($id)); no luck with either :S if anyone has had this problem and found a viable solution, maybe you can point me in the right direction? Link to comment https://forums.phpfreaks.com/topic/263506-incrementing-a-value-using-pdo-mysql/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 1, 2012 Share Posted June 1, 2012 out is a reserved mysql keyword and would need to be enclosed in back-ticks to prevent an error in your query. Your query error checking logic would have been giving you an error near the first use of out in the query. Link to comment https://forums.phpfreaks.com/topic/263506-incrementing-a-value-using-pdo-mysql/#findComment-1350431 Share on other sites More sharing options...
RobertP Posted June 2, 2012 Author Share Posted June 2, 2012 out is a reserved mysql keyword and would need to be enclosed in back-ticks to prevent an error in your query. Your query error checking logic would have been giving you an error near the first use of out in the query. thank you so much (did'nt know about the out-keyword) Link to comment https://forums.phpfreaks.com/topic/263506-incrementing-a-value-using-pdo-mysql/#findComment-1350518 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.