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.