CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 trying to get CCDLookup to work.

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message
RES

Posts: 21
Posted: 06/09/2005, 11:08 AM

thanks mrachow. both recommendations worked flawlessly the first try.
_________________
RES
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.