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

 CCDLookUp Syntax

Print topic Send  topic

Author Message
lammy

Posts: 49
Posted: 03/04/2005, 1:26 PM

I am having a bit of trouble getting the code below to work, could somebody kindly fill in the blank section. I want to forward a password onto the email address in $to but need to obtain it from the database. this code is situated in the onclick event of the submit button

//Send Email @233-06488961
global $forpassword;
global $DBdatabase;
ini_set("SMTP", "****.****.****.co.uk");
$to = $forpassword->passwordsearch->GetText();
$subject = "Password Reminder";
$forpassword->member_password->SetValue(CCDLookUp("member_password", "members", "email=" :-) THE BLANK SECTION :-) $DBdatabase));
$message = $forpassword->member_password->GetText();
$from = "Administration";
$additional_headers = "From: $from\nReply-To: $from\nContent-Type: text/html";
mail ($to, $subject, $message, $additional_headers);
ini_restore("SMTP");
//End Send Email
View profile  Send private message
peterr


Posts: 5971
Posted: 03/04/2005, 2:58 PM

Something like this might work:
$forpassword->member_password->SetValue(CCDLookUp("member_password", "members", "email=" . $to ,$DBdatabase));

If it doesn't work you may want to try printing couple of the values to check which one might be blank, like:
echo $to;
echo CCDLookUp("member_password", "members", "email=" . $to ,$DBdatabase);

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
lammy

Posts: 49
Posted: 03/04/2005, 11:59 PM

Thanks for the reply, I actually now get this error which I havent had before.
using echo all fields where correct

cheers

Database error: Invalid SQL: SELECT member_password FROM members WHERE email=ilammas@ntlworld.com
MySQL Error: 1064 (You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '@ntlworld.com' at line 1)
Session halted.
View profile  Send private message
DonB
Posted: 03/05/2005, 6:01 AM

You are not enclosing the string in quotes (the email address in your
WHERE).

--
DonB

http://www.gotodon.com/ccbth
peterr


Posts: 5971
Posted: 03/05/2005, 10:18 AM

Yeah, that was my mistake. The code may need to be:
$forpassword->member_password->SetValue(CCDLookUp("member_password", "members", "email='" . $to ."'" ,$DBdatabase));
or
$forpassword->member_password->SetValue(CCDLookUp("member_password", "members", "email=" . $DBdatabase->ToSQL($to, ccsText) ,$DBdatabase));

I didn't test it, so you may need to resolve such minor issues when testing.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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