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
menu_id 10
is_active 1
ordering 100
Can anyone assist?
10-02-2012, 05:50 PM
mbaldwin
Hi, I have not tested this, but this should do the trick for you.
PHP Code:
$sql = 'INSERT INTO temp_user_id (user_id, menu_id, is_active, ordering) SELECT user_id, menu_id, is_active, ordering from USER_ID';
MYSQL_QUERY($sql);
This is of course if i understand you correctly, you basically want to copy information from one table to another?