Re: IF Statements
| From: | James Mclean | Date: | Mon, 14 Jan 2002 03:23:13 +0000 |
| Subject: | Re: IF Statements | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80416@lists.php.net to get a copy of this message | ||
Hi,
> My problem is working out how to evaluate this new part. I have normal
> If
> statements for the listing, adding, etc. But how can I get it to check
> if
> clientcode is present. If clientcode is not present I want it to load
> the
> list page as normal. But if the clientcode is present then it is to
> load
> something else.
>
> How do I structure my IF statement?
If i understand correctly, you need something like this...
$sql = "select clientcode from table where clientcode='$var'";
$qu = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($qu)=='0') {
//does not exist
} else {
//exists
//loop through records here.
}
hmmz might be wrong... just came back from a few weeks of holidays.
Regards,
James Mclean
Adam Internet Web Design Team
» james@adam.com.au | www.adam.com.au «
» 199 Sturt St. | P: 8231 0303 «
» Adelaide 5000 | F: 8231 0223 «
"Windows didn't get as bad as it is overnight -- it took over ten years of
careful development."