469,640 Members | 1,563 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,640 developers. It's quick & easy.

Insert data through dropdown box

250 100+
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?
Feb 12 '08 #1
1 1896
dlite922
1,584 Expert 1GB
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 $dropDownBoxValue then...

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

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


[/PHP]
Feb 12 '08 #2

Post your reply

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

Similar topics

2 posts views Thread by Tavish Muldoon | last post: by
2 posts views Thread by Santo Santis | last post: by
1 post views Thread by Doc11 | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.