RES
Posts: 21
|
| Posted: 06/09/2005, 8:07 AM |
|
here is my code:
global $DBNPCT;
//global $default;
$result = CCDLookUp("*", 'SAV_USER_PROFILES', 'IP_ADDRESS='."'".$ip."'", $DBNPCT);
//$default->SetValue($result);
if($result=0){
print "<p>no results</p>";
}
else {
print $result;
}
On my page, i get a print out of "0" as opposed to the "no results" print. please assist as to what i am doing wrong. eventually i am going to change the print "no results" to a redirect.
_________________
RES |
 |
 |
mrachow
Posts: 509
|
| Posted: 06/09/2005, 8:51 AM |
|
Your query will return the content of the first column of table SAV_USER_PROFILES.
So instead of * use a certain column or count(*).
With if($result = 0) you assign zero to $result.
Try 0 = = $result.
I personally always start a comparison with the constant to get an error when accidentally doing an assign.
_________________
Best regards,
Michael |
 |
 |
RES
Posts: 21
|
| Posted: 06/09/2005, 11:08 AM |
|
thanks mrachow. both recommendations worked flawlessly the first try.
_________________
RES |
 |
 |
|