Skip to content
Advertisement

PHP SQL Views counter using PDO prepare()

I have a variable $id which gives me the id of the current article and this can help me to make an update query in my database on current article.

This is my code:

I don’t get any errors but my code is still not working…

Advertisement

Answer

Your correct code is here:

; from the end of sql is not needed here and viz = viz must become viz = :viz because of PDO.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement