Hello, hope this does not sound to stupid but I have a form that post data to a table and it works fine. I would like a dropdown in the form to select different tables to post to... does that make any sense? sorry
EDIT:
ok so maybe im not being to clear. I will try to explain better. I have a form right now that post to a processing page that connects to a database called "reservations" and inserts all the field info to a table called "one" and everything works fine. What I would like to do is have a dropdown at the top of the page that dropsdown saying
one
two
three
those names represent other tables. When you select lets say two and fill the form out and submit it. It than post in table two
Last edited by cantfoo; 2008-03-18 at 06:32 PM.
Reason: not to clear and not getting any response
If I understand you correctly, you want to insert your data into different tables depending on the input from your dropdown menu. If this is right then what you are asking is really easy. On reservations.php simply change your insert query to be a little more dynamic.
Code:
$sql = "INSERT INTO `" . $_POST[number] . "` SET " .. you get the idea
thank you so much for the reply.. Im afraid im a little stupid.. lol... I understand replacing the that line of code but the set and number part i dont understand... thank you for any further assistance you can give me im new to this and just kind of stumbling through it
Must read Review for Serious PHP Developers
NuSphere PhpED 5.0
: The Staff of php-editors.com recently spent a few days working with NuSphere
PhpED 5.0
(a popular PHP IDE) and
NuCoder 1.4
(a PHP Encoding Utility), read up on all the details.