By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,919 Members | 1,587 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,919 IT Pros & Developers. It's quick & easy.

How to send option values to diffrent db tables

P: 3
Expand|Select|Wrap|Line Numbers
  1. <select class="formFields">
  2. <option value="test">test</option>
  3. <option value="test2">test2</option>
  4. <option value="test3">test3</option>
  5. <option value="test4">test4</option>
  6. </select>
( I want to send each option value to a different table in db)
so i can have each categories for each table
Apr 13 '12 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 10K+
P: 12,364
I have no idea what your goal is. Why would they be in their own table?
Apr 13 '12 #2

P: 93
first save the value of option in temp_variable then write a query ( if you have make first each table for each category)

Expand|Select|Wrap|Line Numbers
  1. $table_name = $_POST['category_option'];
  2. query == >
  3. $qry = "insert into ".$table_name." values(1,'product_name',100)";
  5. $query = mysql_query($qry) or die(mysql_error());
try it .....

Bharat Parmar (Bharat383)
Apr 14 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.