I have a Wordpress blog running on a MySQL database and I'd like to add a custom field with a key name of "googlead" and a value of "1".
Can someone give me a hand on a query that will add this custom field to all 425 posts on my blog?
| SitePoint Sponsor |



I have a Wordpress blog running on a MySQL database and I'd like to add a custom field with a key name of "googlead" and a value of "1".
Can someone give me a hand on a query that will add this custom field to all 425 posts on my blog?
To add a field to a table, read this: http://dev.mysql.com/doc/refman/5.1/en/alter-table.html
Guido - Community Team Advisor
Do you know where the (database) error is? Add it to the list!
Thinking Web: Voices of the Community
Blog - Free Flash Slideshow Widget



guido,
Thanks for the link - any chance you have one that's in plain english? I don't know the first thing about MySQL or running queries. :\

do you have access to a GUI tool like phpmyadmin? it's pretty self-explanatory for simple operations like adding a column to a table.
Check out our new Industry News forum!
Keep up-to-date with the latest SP news in the Community Crier
I edit the SitePoint Podcast
What table do you want to add the field to?
What do you need this field for? Do you have to change some Wordpress PHP script as well?
Guido - Community Team Advisor
Do you know where the (database) error is? Add it to the list!
Thinking Web: Voices of the Community
Blog - Free Flash Slideshow Widget



Guido - Community Team Advisor
Do you know where the (database) error is? Add it to the list!
Thinking Web: Voices of the Community
Blog - Free Flash Slideshow Widget



well, it's a start
Once you have the new field, do you have to put the value '1' in all rows, or in specific rows?
Guido - Community Team Advisor
Do you know where the (database) error is? Add it to the list!
Thinking Web: Voices of the Community
Blog - Free Flash Slideshow Widget
Bookmarks