| 
	
 | 
 Posted by Harold Ralston on 06/15/70 11:47 
In a way, because of flaming, I feel hesitant to add another  
response but, this is what seems to work for me: 
<?php 
if(empty($surname)) 
{ 
$surname=0; 
echo "Please enter valid surname."; 
} 
  ?> 
Thanks for the helpful suggestions. 
Harold 
 
Martin Jay wrote: 
> In message <swa9g.747$n14.254@fe03.lga>, robert  
> <ab@no.spam-alama-ding-dong> writes 
>  
>> <snip> 
>> 
>> | I offered the "magic code" 
>> | alternative as a way for him to avoid modifying code he was unsure 
>> | about. 
>  
>  
>> again, magic code is NEVER a good plan, strategy, or methodology for any 
>> programming endeavor. and what's worse is that you are encouraging  
>> this kind 
>> of bad behavior/habit in someone whom you believe is completely new 
>> tocoding. that's worse than bad form! 
>  
>  
> LOL.  Careful snipping so you can continue to make the same point AGAIN  
> and AGAIN.  I didn't advise using the method or encourage it. 
>  
> I wrote: 
> "...you could give $surname a nonsense value before doing the search." 
>  
> It's a statement of fact. 
>  
>> the IDEAL solution would be to handle this in the sql statement and  
>> NOT the 
>> code...like: 
>> 
>> SELECT     * 
>> FROM       foo 
>> WHERE      fieldSearched   = '$valueToFind' 
>> AND        '$valueToFind' != '' 
>> 
>> problem solved! 
>  
>  
> "THE" SQL?  I didn't see anything about SQL mentioned.
 
  
Navigation:
[Reply to this message] 
 |