Unable to add new table to database ... sort of (2 posts)

  1. wmrom
    Posted 6 years ago #

    I'm writing a plugin which I hope to release in the future. The plugin will add a table to the database when activated. I followed the instructions here, but nothing happedned. I didn't get an error, but it didn't create the table either. I copied and pasted the code straight from that page and that didn't work.

    On PHPMyAdmin, I added the table manually and the SQL it showed as having been executed had put the table name and field names inside backticks. I modified the plugin, dropped the table, and re-activated it, and it worked. Does anybody know why this is? Why is there a discrepancy between WP's docs and what works?

  2. MichaelH
    Posted 6 years ago #

    Might look at using maybe_create_table such as use by http://wordpress.org/extend/plugins/wp-postratings/

    But this thread is interesting:

Topic Closed

This topic has been closed to new replies.

About this Topic