Database INSERT changes default 'no' to NULL |
(03-06-2016, 11:34 PM)Narf Wrote: You're explicitly inserting NULL ... of course that's what's going to be inserted. The default value is used only if you provide no value at all - i.e. if the field in question is not listed in the INSERT statement. So if I test for a value PHP Code: if (isset($_POST['guidelines_signed']) && $_POST['guidelines_signed'] == 'on') and skip this field if the checkbox is not selected, the default value I gave it in the database will be inserted instead? |
Messages In This Thread |
Database INSERT changes default 'no' to NULL - by webmachine - 03-06-2016, 11:55 AM
RE: Database INSERT changes default 'no' to NULL - by skunkbad - 03-06-2016, 12:53 PM
RE: Database INSERT changes default 'no' to NULL - by webmachine - 03-06-2016, 08:05 PM
RE: Database INSERT changes default 'no' to NULL - by Bhavesh - 03-06-2016, 09:59 PM
RE: Database INSERT changes default 'no' to NULL - by Narf - 03-06-2016, 11:34 PM
RE: Database INSERT changes default 'no' to NULL - by webmachine - 03-07-2016, 04:23 PM
RE: Database INSERT changes default 'no' to NULL - by Bhavesh - 03-07-2016, 09:48 PM
RE: Database INSERT changes default 'no' to NULL - by skunkbad - 03-07-2016, 04:51 PM
RE: Database INSERT changes default 'no' to NULL - by skunkbad - 03-08-2016, 03:21 AM
RE: Database INSERT changes default 'no' to NULL - by keulu - 03-08-2016, 03:47 AM
|