This topic is locked

Sending additional email to user in another table.

9/16/2009 5:46:10 AM
PHPRunner General questions
M
mmponline author

I'm using the standard code to send an e-mail to the hardcoded address Eg.:
//** Send email with new data ****

$email="test@test.com";
after editing a record.
The code works fine.
I now have a need to send a copy of this e-mail (in this case Email field in the Login table) as well. How can I achieve this? I know I have to do some select query like:

global $conn,$strTableName;

$email = "";

$str = "select Email from Login where LoginID=".$_SESSION[$strTableName."_masterkey1"];

$rs = db_query($str,$conn);

if ($data = db_fetch_array($rs))

$email = $data["Email"];


but this returns an error

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 '' at line 1
Please assist.