[wp-hackers] Creating / Inserting into Table named after WP Username

J.D. Grimes jdg at codesymphony.co
Sun Aug 25 12:50:42 UTC 2013


> I still don't understand the benefit of using usermeta vs my own database.
> I googled for information about it but don't see any strong opinions one
> way or the other.
> 
> The only reason I am doing it this way is because I want to have a
> historical record - Meaning show the whole table, including all rows, which
> will be dated and include several rows.  wp_usermeta only allows for one
> value per key and updating it results in the loss of the previous entry.
> That wont work for me.


In this case, I'd say it makes sense to use a custom table, not usermeta.

> Additionally, assuming I create a new table in the wordpress database and
> associated each entry with the user->id that would still be a very messy
> way to store the data for hundreds of users who all have 20-40 entries
> each.  Am I missing something here?

I guess it's partly a matter of opinion, but I'd say it would be much messier to have hundreds of tables in my database, each with only 20-40 entries in them. Also, if you feel you must do it this way, use a unique prefix for the tables. Otherwise you are just asking for trouble, if someone registers on your site with a username that just happens to match the name of one of your other tables.



More information about the wp-hackers mailing list