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

 DLookup (again)

Print topic Send  topic

Author Message
Waspman

Posts: 948
Posted: 09/21/2007, 9:46 AM

anyone know why this doesn't work...

$to = CCDLookUp("Email", "users", "UserID =".$quotes->OwnerID->GetValue(),$DBconnection1);

also tried..

$to = CCDLookUp('Email', 'users', 'UserID ='.$quotes->OwnerID->GetValue(),$DBconnection1);


Ta.....Tony
_________________
http://www.waspmedia.co.uk
View profile  Send private message
wkempees


Posts: 1679
Posted: 09/22/2007, 3:12 AM

Not enough info.
Syntax looks ok, both single (preferred) and duoble quoted.
Need surrounding code, like in which event?
Is connection name ok and globalled, same for $quotes.
Show us more.
Walter

echo 'value =' . $quotes->OwnerID->GetValue();
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
Waspman

Posts: 948
Posted: 09/22/2007, 3:42 AM

Sorry W,

It is the email code created by CCS in the send email event:


global $quotes;
$OwnerID = $quotes->OwnerID->GetValue();
$to = CCDLookUp('Email', 'users', 'UserID ='.$quotes->OwnerID->GetValue(),DBconnection1);
$subject = "Quote submitted for job/project ".$Component->Title->GetText();
$message = "Submitted for your job/project ".$Component->Title->GetText();
$from = "email@address.com";
$additional_headers = "From: $from\nReply-To: $from\nContent-Type: text/html";
mail ($to, $subject, $message, $additional_headers);


Thanks again..


T
_________________
http://www.waspmedia.co.uk
View profile  Send private message
Waspman

Posts: 948
Posted: 09/22/2007, 8:52 AM

Sussed, it should have been...


$to= CCDLookUp('Email', 'users', 'UserID ='.$quotes->OwnerID->GetValue(), $Page->Connections["Connection1"]);


Getting there...:-)
_________________
http://www.waspmedia.co.uk
View profile  Send private message
nhbw19t


Posts: 29
Posted: 09/23/2007, 12:48 PM

you need to put double quotes around your fields and tables. A DLookUp is a single select statement without the select, from, and where words.

In the Where clause you will need to include your single qoute around your text field or

use the ToSql method

$DBconn->ToSQL(var, ccsText); This will put in the single quotes for you.
_________________
J.D. Archer
GE Transportation
View profile  Send private message
wkempees


Posts: 1679
Posted: 09/24/2007, 4:05 AM

Tony
Working now?
Check PM
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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