Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

eckul on "executing a mysql query on publishing of post"

$
0
0

Hi I would like to post some data to a db when certain categories are selected in a WP post. I would like this to action when the post is made.

This is the query I wan to run:

mysqli_query($con,"UPDATE persons SET Age=Age+1
WHERE FirstName='Peter' AND LastName='Griffin'");

and I want it to happen upon the publishing of the post and only when categories with id's 2 and 3 are both selected.

I've been trying for days now to get this right it's a little over my head. Any help would be greatly appreciated. Thankyou


Viewing all articles
Browse latest Browse all 8245

Trending Articles