Jump to content

inserting data into the database using an option from a list button


nphilipe

Recommended Posts

Hey guys!can someone please help me with this code...am trying to insert some data into the database and apparently, the field name for the data to be inserted into is among the list button selections.ie the list button selections are the corresponding sql fieldnames.i want whatever is entered into the links field to be inserted into the selected table in the dropdown list.is this possible?  Here is the code:

18443_.php

If I understand your question correctly,

 

$rowname = $_POST["category"];

$inserted_stuff = $_POST["link"];

 

/* For col name- */

 

mysql_query("INSERT INTO table ($rowname)VALUES('$inserted_stuff'));

 

/* Or for table name */

 

mysql_query("INSERT INTO $rowname (colname)VALUES('$inserted_stuff'));

---

Dan White

UK based PHP developer & web designer.

 

http://Dans-Media.com

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.