CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Multiple where clauses in a CCDLookup

Print topic Send  topic

Author Message
Nick

Posts: 4
Posted: 09/20/2005, 5:17 AM

Using PHP and MySQL.

I'm trying to hide a record form if a user has already saved a job, to stop them saving it again. To do this i've been using a CCDLookup on a before show event, but I can't seem to get it working for multiple WHERE clauses.

Is it possible to do 2 where clauses in a CCDLookup? I've tried to do it using the following method, but keep coming up trumps!

global $saved_jobs;
$db = new clsDBConnection1();
$Result=CCDLookUp("saved_jobs_candidateID", "saved_jobs", ""saved_jobs_jobID = ".CCGetParam("job_id","")."" AND "saved_jobs_candidateID = ".CCGetUserID().""",$db);
if ($Result == CCGetUserID()) {
$saved_jobs->Visible = False;
}

Thanks in advance.
View profile  Send private message
Nick

Posts: 4
Posted: 09/20/2005, 7:53 AM

Sorry I forgot to say i'm not getting a parse error when i view the page, but the it's not hiding the record form either!
View profile  Send private message
feha


Posts: 712
Posted: 09/20/2005, 1:41 PM

YES
example
  
$Result=CCDLookUp("COUNT(*) main_id", $table_name, "menu_show=1 AND main_id > 0 AND main_id = ".$db->f("menu_id")." AND menu_level <= ".CCGetGroupID(), $db_sub);  

or
  
$Result=CCDLookUp("main_id", $table_name, "menu_show=1 AND main_id > 0 AND main_id = ".$db->f("menu_id")." AND menu_level <= ".CCGetGroupID(), $db_sub);  
Hope this gives you an idea :-)


_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
Nick

Posts: 4
Posted: 09/21/2005, 3:19 AM

Thanks feha, I changed a few quotes around and it's now working great!

Just in case someone needs a similar example here's the code that I ended up with:

global $saved_jobs;
$db = new clsDBConnection1();
$Result=CCDLookUp("saved_jobs_candidateID", "saved_jobs", "saved_jobs_jobID = ".$saved_jobs->saved_jobs_jobID->GetValue()." AND saved_jobs_candidateID = ".$saved_jobs->saved_jobs_candidateID->GetValue(),$db);
if ($Result == CCGetUserID()) {
$saved_jobs->Visible = False;
}
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.