Re: Assigning a value from another value
| From: | Leif K-Brooks | Date: | Sun, 13 Apr 2003 19:52:43 +0000 |
| Subject: | Re: Assigning a value from another value | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143688@lists.php.net to get a copy of this message | ||
mysql_query('insert into ... set fieldname=\''.($_POST['textlabel'] == 'yes' ? 1 : 0).'\' ...');
Hunter, Jess wrote:
I hope I can present this properly in simple terms. I have a form that when submitted is actually creating a new record in one table and updating a record in another table. In one table the field is a number while in the other it is a text. So if a person selects "yes" on the form, it will input yes, into one field, while it will add a "1" in the other. so in a nutshell: If textlabel='yes' then insert a '1' into fieldname, else insert '0' Thanks in advance Jess-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.