Re: checking

From: Date: Sun, 30 Jun 2002 22:49:49 +0000
Subject: Re: checking
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-104768@lists.php.net to get a copy of this message
In article <03d201c21db6$7deb2110$7800a8c0@leonard> , kaleonardo@BonBon.net (Leo) wrote: >I have a form and I don't want to insert recording with blank value. >I put: >if ($lastname="") { > $insert="no" >} >if ($insert="no"){ > do not insert; >else > insert; >} >my probleme is in some case $lastname="" is true and other case is false. >I tried with $lastname=" " but no change. how can I check if a varible is >empty or not? if (isset($lastname)){ # Do MySQL insert } http://php.net/isset NOTE: CHECKBOX variables will not show up unless checked, so this technique will not necessarily work for them, depending on what business logic you are trying to achieve... -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#104768) next »