Anthony
|
| Posted: 08/10/2002, 11:11 AM |
|
I have created several applications that DOES NOT require al fields to be filled out. When I submit the application with blank fields Im getting Mysql error:
Database error: Invalid SQL: INSERT INTO `users` (`username`, `password`, `Company_Name`, `Position`, `Contact_First_Name`, `Contact_Last_Name`, `Billing_Address`, `City`, `State`, `Postal_Code`, `Phone`, `Email`, `Fax`, `Preference1`, `Preference2`, `Preference3`) VALUES ('gh', 'jgfhj', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
MySQL Error: 1048 (Column 'Company_Name' cannot be null)
Session halted.
My database fields are set to 'Not-Null' so why the error.
any suggestions?
Would removing the 'value' attribute from the HTML form correct this or do I have to modify something else.
|
|
|
 |
char
|
| Posted: 08/11/2002, 6:55 AM |
|
Anthony
"I have created several applications that DOES NOT require al fields to be filled out"
The fields should be set to null
|
|
|
 |
Nicole
|
| Posted: 08/13/2002, 12:24 AM |
|
Anthony,
you should allow null values for the fields in table. If it is impossible you should assign default values to all the fields that are not-null.
To do it add them all the form and set their type to Hidden. Then enter default value into Default Value section.
|
|
|
 |
|