If you declare the fields as NOT NULL in mysql table, during insert, if
you are nor insertint the field, it will default to 0 (for numbers) and
'blank' (for text fields). If you already have a table update column to
0 or blank and do 'alter table' to make the field not null
Johnson, Kirk wrote:
> You may want to check the field definitions in the database table. If I
> recall correctly, some MySQL numeric field types default to "0" when an
> empty string gets written to them. The problem (and solution) may not be in
> the PHP script at all.
>
> Kirk
>
>> -----Original Message-----
>> From: Michael Conley [mailto:[EMAIL PROTECTED]]
>> Sent: Thursday, March 15, 2001 1:01 PM
>> To: 'Chris Lee'; [EMAIL PROTECTED]
>> Subject: RE: [PHP] Variable value doesn't stay "Null"
>>
>>
>> So how do I get the PHP script that stores the information in
>> the My SQL
>> database to not store "0"? a "0" value is a valid value for
>> this variable.
>> I don't want 0 to be the value of the variable if nothing is
>> entered. Right
>> now, the database is populated with 0's for the fields that
>> are not filled
>> in.
>>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]