I was wondering if there is a way to create a MySQL table for each ID that exists in another table. I think that would be fairly easy doing it with PHP, but I’m not sure if that can be done with MySQL.
So for instance I have a table called users which has an X amount of columns. One column is the IDs column. So I would like to iterate through that column and grab the IDs and create for each of those IDs a new table which will have the name of "user_specific_id_ " + ID. So for the ID 1 the name of the newly created table would be user_specific_id_1.
Could the above be done just with MySQL, or is it necessary to use PHP ? And if I need to use PHP what would be the approach ?
I’m not familiar with a pure MySQL way. Using PHP you’ll select all id’s from your table, and then in a
foreachloop issue aCREATE TABLE user_specific_id + $idqueryThat being said, creating a separate table for each user doesn’t sound like the correct way of handling a DB.