Forum Moderators: coopster

Message Too Old, No Replies

Dynamically changing the table to insert the data to ...

using a drop down menu

         

le_gber

11:21 am on Jan 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi all,

I wanted to dynamically change the table in which I am inserting data according to the value selected in the drop down menu of the submitted form.

Is this possible? How to do it?

Thanks or your help

Leo

coopster

2:50 pm on Jan 8, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Are you inserting or updating data in your table? If you want to INSERT data in your table with a value selected by the user on an HTML form, you simply use the POSTed data:

$sql = "INSERT INTO table VALUES('" . $_POST['select_name_from_HTML_form'] ."')";

jatar_k

5:51 pm on Jan 8, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



or

$sql = "INSERT INTO " . $_POST['tablename'] . " VALUES('" . $predefined_cols ."')";

le_gber

11:24 am on Jan 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Cheers guys!

Leo