Timeline for Proper Prepare Statement for ALTER TABLE and using AFTER
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 27, 2015 at 15:48 | history | edited | birgire | CC BY-SA 3.0 |
Added tags, improved formatting, removed code scrollbars.
|
Dec 27, 2015 at 15:34 | answer | added | LPH | timeline score: 1 | |
Dec 27, 2015 at 15:28 | comment | added | LPH |
Thank you @TomJNowell -- your comments pushed me to stop altering the table. The key being update_post_meta ( $post->ID , 'forum_id', $thread_id ); instead of all the mysql code. Retrieving the meta data was just as easy.
|
|
Dec 23, 2015 at 12:06 | comment | added | Tom J Nowell♦ |
Nevermind OOP, you can replace all your SQL queries with WP_Query loops and calls to get_post_meta , eliminate your table creation and update code entirely, and as a bonus you get a free GUI
|
|
Dec 23, 2015 at 5:03 | comment | added | LPH | I understand but at this point the plugin was written 2.5 years ago and I'm slowly moving it to OOP as well as fix mistakes such as modifying the post table as well as the comments table. For now, I simply need to know a better way to use ALTER TABLE until I can get the code working for post meta. | |
Dec 21, 2015 at 23:16 | comment | added | Tom J Nowell♦ |
Modifying the posts table to add a forum_id is a bad idea, you should use post meta to store values, or use a custom taxonomy if you're trying to organise posts
|
|
Dec 21, 2015 at 23:07 | history | asked | LPH | CC BY-SA 3.0 |