View Full Version : insert data from one table to another

05-23-2011, 08:38 PM
I insert some data into a sales table when a user make a transaction, and i want to add the userid in that table. How can i do that? i tried some session stuff but i found it a bit complicated.

05-23-2011, 08:40 PM
Uh... rather vague question. How do you store the users data? Sessions seem the best/only real way to do it. I assume you store the user's ID in a session value somehow, hashed or not?

05-23-2011, 09:44 PM
atm i am trying to insert the username instead of the id.

i display the current username through a session

Welcome <?php echo $_SESSION['MM_Username']?>

I try this but it inserts just a blank username.

$MM_Username = $_SESSION[MM_Username'];

$sql="INSERT INTO sales(address,username) VALUES

05-23-2011, 10:37 PM
ok it work now guys i didnt change comething i just close and reopen the browser, probably a bug. Tnx for help