Re: Variable value doesn't stay "Null"

From: Date: Thu, 15 Mar 2001 16:17:10 +0000
Subject: Re: Variable value doesn't stay "Null"
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-44089@lists.php.net to get a copy of this message
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 lee@mediawaveonline.com "Michael Conley" <mconley@RentHistory.com> wrote in message 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: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#44089) next »