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? Quote 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. Quote 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) Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.