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. -----Original Message----- From: Chris Lee [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 15, 2001 8:17 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Variable value doesn't stay "Null" null is a bad idea. if a value is set to null in a table then that variable will not be set. name phone fax email chris lee 3771095 5541120 NULL $result['name'] is 'chris lee' $result['phone'] is '3771095'; $result['fax'] is '5541120'; $result['email'] is an undefined variable in php a variable is set or not set. if it set to '' its still set, if a variable is undefined, then it is null. -- Chris Lee [EMAIL PROTECTED] "Michael Conley" <[EMAIL PROTECTED]> wrote in message 2102328FD2ECD411879E00609737BFD10333E3@FATBOY">news:2102328FD2ECD411879E00609737BFD10333E3@FATBOY... I put up an HTML page that allows a user to modify some previously entered information. The information is taken from a MySQL database and displayed on the page. The user can leave the data alone or modify it. If there is no information in the database for one of the fields, the input box is empty. The problem is that when I submit this information, the page that is called does not receive the variables from fields with no information as "null". Instead, it gets them with something other than null, although if I print the variable, they come out blank. I check the variable using "is_null" and they evaluate as not being null. When my script then enters the information into the MySQL database, a value of "0" is entered for the numeric fields. Having these "0" values in the database gives me the wrong information. Any idea why an input field that is populated with a null value would go to the next page as a not null value (although no value shows up for it until it is written to the database)? ---------------------------------------------------------------------------- ---- -- 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] -- 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]
-- 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]