Help with mysql insert
I have a table called users and another called temp_user_id.
Table temp_user_id has 5 columns:
Column Name Type Auto-Increment
menu_order_id int(11) Yes
I want to select all user_id from the users table and insert them into the table temp_user_id with the values below in the other columns. The expected values are below:
menu_order_id Auto-Incremented ID
user_id user_id from users table
Can anyone assist?
Hi, I have not tested this, but this should do the trick for you.
This is of course if i understand you correctly, you basically want to copy information from one table to another?
$sql = 'INSERT INTO temp_user_id (user_id, menu_id, is_active, ordering) SELECT user_id, menu_id, is_active, ordering from USER_ID';
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)