Should I use PHP to put a WordPress User ID in my DB table?
-
The goal is simple. A WordPress member should have the ability to create multiple role-playing characters with some basic information.
So it takes two tables to get this to start working.
In PHPMyAdmin
The “wp_user” table has a primary key for an “ID” column. This is the ID that belongs to a WordPress member. I need this to work with my second table.The table “characters” contains two fields. A varchar field “name” for a character name, and a foreign key field called “ID”.
These two tables have a Primary/Foreign Key relationship. I need to make sure that the “ID” in the “wp_user” table can have multiple “name”s in the “characters” table.
MY QUESTION: So lets say I make an html form that the WordPress member can insert a character name into. Should I also try to grab their User ID and insert that into the “characters” table? Or should I try a different method in PHPMyAdmin using SQL?
Thanks in advance!
- The topic ‘Should I use PHP to put a WordPress User ID in my DB table?’ is closed to new replies.