Insert data through dropdown box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghjk
    Contributor
    • Jan 2008
    • 250

    Insert data through dropdown box

    I want to insert data through my web application. I have dropdown box (have 2 values Yes and No)and when i select yes insert record will be 5 and when i select no insert record will be 3. So i cant insert data using same query in php. How can i insert data depend on user selected value?
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Originally posted by ghjk
    I want to insert data through my web application. I have dropdown box (have 2 values Yes and No)and when i select yes insert record will be 5 and when i select no insert record will be 3. So i cant insert data using same query in php. How can i insert data depend on user selected value?
    From the amount of information you gave? You'll only need an if Statement.

    [PHP]

    // assuming you have that YES NO value in a variable called $dropDownBoxVal ue then...

    if (strtoupper($dr opDownBoxValue) == 'YES')
    {
    //insert 5 records
    }
    if (strtoupper($dr opDownBoxValue) == 'NO')
    {
    //insert 3 records
    }

    This is not a joke! Give more info = get better answer.


    [/PHP]

    Comment

    Working...