SILLY DOUBT

General discussions related to php

Moderators: macek, egami, gesf

Post Reply
johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: SILLY DOUBT

Post by johnj » Fri Jul 20, 2012 7:34 am

Well, if the option is mapped to the table value then you have to give one of those values. First add this to the table and then use that value.

For now, maybe you can use '-1' as an option for this.

User avatar
Nullsig
php-forum Fan User
php-forum Fan User
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: SILLY DOUBT

Post by Nullsig » Fri Jul 20, 2012 8:56 am

To elaborate on JohnJ's response. Your default option should be a value that cannot exist in the table field that generates the rest of your results. If you are using only positive integers in the table then negative numbers are good. If you are using items from the full integer range, then you should use a string value. So on and so forth.

Once you submit the form that contains this select box you need to manually handle the catch for whatever value you have set. So if -1 is your value you will need to say

"If submitted value is -1 then create a new record else handle submission as normal"

johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: SILLY DOUBT

Post by johnj » Sat Jul 21, 2012 5:41 am

thanks Nullsig.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest