Can anyone tell me how to select a value from one cell in "table1" and send it to "table2"? What i have is a page where a user can upload a file but shouldn't have to enter his user id since he's already signed in to the site. The user ids are stored in table1 while the upload info goes to table2. i want to keep track of who uploads what. A session has been started so i figure i might be able to reference the $_SESSION['user_id'] to insert in to table. I have been experimenting with this and have read the manual on this and JOINS but either this won't work or im getting the syntax wrong.
Hi,
please post the code.
Thomas
The nominal way is to use an insert / select statement:
insert into table2 (col1, col2, col3, col4) (select col1, col2, col3, col4 form table1 where col1 in (1,2,3,4));
or something like that.