I'm currently working with a form that i want it to update a table due to the answer provided by the user.
ex; if the user fill the form and says he is male, I want it to go to a table for males only and if the user answers female, then i would like it to go to a female only table on mysql database. can someone help me?
How to upload to an expecific table in mysql due to answer
Moderator: General Moderators
-
ronald1989
- Forum Newbie
- Posts: 1
- Joined: Fri Feb 24, 2012 1:28 am
Re: How to upload to an expecific table in mysql due to answ
Code: Select all
$gender = ((int) $_POST['gender'] == 1) ? 'male_table' : 'female_table';
$query = "UPDATE {$gender} SET blah blah whatever";