Jump to content

[SOLVED] How to: Retrieve from table x to table y


nitation

Recommended Posts

Good day Gurus.

 

I have an admin area where i add an amount. What i wanna achieve is, i wanna select a user_id from table x and insert it to table y for a specific user. Note: the specific user's ID is retrieved from table x in a drop down menu. How do i get the user_id from table x and insert it to table y since my drop down menu will list all the user's in the table. That means my user's sessions is not applicable here since am in the admin area. 

 

Thanks in advance

i am kinda confused but i think this is what you want

if you have a drop down menu like this

<select name="user_id">
<option value="1">john</option>
some php loop through table_x
<select>

then have a sql query like this

INSERT INTO `table_y` (`user_id`) VALUES ('{$_POST['user_id']}');

 

Scott.

Note: the specific user's ID is retrieved from table x in a drop down menu.

 

 

The problem is i don't want to select the userid from a drop down menu.

 

??? what exactly do you want?

??? what are your table structures?

??? what exactly should be inserted from one table into the other?

 

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.