Jump to content

data information from one table to another


kasitzboym

Recommended Posts

Hi everyone... I have kind of a complicated problem that i hope someone can help me with.

 

I have a registration section of my site already up and running... i am trying to create another section of my site so that the user that is logged in can create a posting and link it to their username.... currently i have two tables in a mysql database one named (users) to hold the username and password that i want to pull the username from and another that holds the information for posting called (laf)....

 

My basic question is how can i pull the username from the (users) database and place it into the (laf) database when they post?

 

This is a really hard thing to explain i know, if anyone can help or needs any more information let me know...

 

Thanks in advance

if you set the username as $_SESSION['user'] then you could use something like this:

 

mysql_query("INSERT INTO laf (username, data) VALUES('" . $_SESSION['user'] . "', '" . $data. "');

 

then list like:

mysql_query("SELECT * FROM laf WHERE username='" . $username . "'");

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.