How to send option values to diffrent db tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beezgoodtimez
    New Member
    • Apr 2012
    • 3

    How to send option values to diffrent db tables

    Code:
    <select class="formFields">
    <option value="test">test</option>
    <option value="test2">test2</option>
    <option value="test3">test3</option>
    <option value="test4">test4</option>
    </select>
    ( I want to send each option value to a different table in db)
    so i can have each categories for each table
    Last edited by Dormilich; Apr 16 '12, 05:49 AM. Reason: Please use [CODE] [/CODE] tags when posting code.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    I have no idea what your goal is. Why would they be in their own table?
    Last edited by Rabbit; Apr 14 '12, 04:49 PM.

    Comment

    • Bharat383
      New Member
      • Aug 2011
      • 93

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


      Code:
      $table_name = $_POST['category_option'];
      query == >
      $qry = "insert into ".$table_name." values(1,'product_name',100)";
      
      $query = mysql_query($qry) or die(mysql_error());
      try it .....

      Bharat Parmar (Bharat383)
      Last edited by Dormilich; Apr 16 '12, 05:50 AM. Reason: :code:

      Comment

      Working...