Re: Re: checking

From: Date: Mon, 01 Jul 2002 20:47:44 +0000
Subject: Re: Re: checking
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-104781@lists.php.net to get a copy of this message
"==" (2) is for comparison while you are accidently doing assignments by "=" (1) if ($lastname="") - wrong if ($lastname=="") - better that's why u r screwed up here :-) Uli At 17:49 30.06.02 -0500, Richard Lynch wrote: >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 > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#104781) next »