| | |
update' select menu
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
You have a name for the dropdown list. Right ? When you submit the form, you get the value of the dropdown list by doing $value = $_POST['dropdownlistname']. Insert/update that value to the table.
You can see here how you can connect, insert or update mysql tables using php.
http://www.w3schools.com/php/php_mysql_intro.asp
You can see here how you can connect, insert or update mysql tables using php.
http://www.w3schools.com/php/php_mysql_intro.asp
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Nov 2007
Posts: 53
Reputation:
Solved Threads: 0
First, let me say thank you for such rapid responses.
I apologize. I'm probably not explaining myself correctly.
I do not have any trouble updating the record with the select menu, what I can't make work is getting the select menu to be 'display' or be 'pre-selected' based on the users input that already lives on the db.
What happens is - when a users chooses to update their record, update.php is a form with all of their fields displayed 'pre-populated' - all but the drop-down menus. I keep getting value =0.
Thanks again.
I apologize. I'm probably not explaining myself correctly.
I do not have any trouble updating the record with the select menu, what I can't make work is getting the select menu to be 'display' or be 'pre-selected' based on the users input that already lives on the db.
What happens is - when a users chooses to update their record, update.php is a form with all of their fields displayed 'pre-populated' - all but the drop-down menus. I keep getting value =0.
Thanks again.
Okay! I saw your other thread. Anyways, this is how you can make it work. Have an onchange event in your selectbox. When a value is selected, submit the page. (document.form.submit()). $_POST['selectboxname'] will have the value selected from the dropdown. Then check if it matches with each option value. If it matches, then echo "selected", or else, echo nothing.
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Nov 2007
Posts: 53
Reputation:
Solved Threads: 0
Again, Thank you.
I'm afraid I understand a little of what you are suggesting to do.
I do not want the form to submit on change.
Can you explainhow to "Check if it matches". I'm doing U.S states (all 50). Would I have to do if /else statements for each?
I hope I am making clear what I am trying to do.
I'm afraid I understand a little of what you are suggesting to do.
I do not want the form to submit on change.
Can you explainhow to "Check if it matches". I'm doing U.S states (all 50). Would I have to do if /else statements for each?
I hope I am making clear what I am trying to do.
![]() |
Similar Threads
- Help me please! (Viruses, Spyware and other Nasties)
- Aurora nuisance here too (Viruses, Spyware and other Nasties)
- Aurora Popups - Can't seem to get rid of them (Viruses, Spyware and other Nasties)
- VX2 spyware help!!! (Viruses, Spyware and other Nasties)
- more aurora probs (Viruses, Spyware and other Nasties)
- Aurora Popups - Can't seem to get rid of them (Viruses, Spyware and other Nasties)
- HELP with spy / ad ware (Viruses, Spyware and other Nasties)
- Problems Windows Update (Windows Software)
- IE6 SP2 Update (KB888240) (Web Browsers)
- Disable Automatic Windows Update (Windows tips 'n' tweaks)
Other Threads in the PHP Forum
- Previous Thread: File upload
- Next Thread: easyPHP installation
| Thread Tools | Search this Thread |
apache api array basic beginner binary broken cakephp checkbox class cms code computing confirm cron curl customizableitems database date delete display dynamic echo email error external file files filter folder form forms forum function functions gc_maxlifetime google headmethod host href htaccess html iframe image include insert ip javascript joomla limit link login mail malfunction memmory memory menu mlm multiple mysql navigation oop parsing paypal pdf php problem query question radio random recursion regex remote script search select server sessions sms snippet soap source space sql syntax system table thesishelp trouble tutorial update upload url validator variable video web xml youtube






