Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2008-03-18, 05:50 PM
Junior Member
 
Join Date: Mar 2008
Posts: 2
cantfoo is on a distinguished road
Default drop down help

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
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2008-03-20, 03:42 AM
Senior Member
 
Join Date: Dec 2004
Posts: 199
strasm is an unknown quantity at this point
Default

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
Reply With Quote
  #3 (permalink)  
Old 2008-03-21, 12:56 AM
Junior Member
 
Join Date: Mar 2008
Posts: 2
cantfoo is on a distinguished road
Default thank you

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
Reply With Quote
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.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:11 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.