This topic is locked
[SOLVED]

 How to get eMail from another table

11/23/2013 6:46:36 AM
PHPRunner General questions
Z
Zaboor author

I have two tables with Profile_ID Key
Orders -> Profile_ID

Orders -> Order_ID

Orders -> Status
Profiles -> Profile_ID

Profiles -> Email
in Orders_edit.php page there is a "Profile_ID" read only field.
How to get the email from Profiles table and send email With Order_ID and Status by "Before Record Updated" Event?
Thanks

Zaboor

Sergey Kornilov admin 11/23/2013

Use ProcessRecordValues event. : save Profile_ID value in session variable.

$rs = CustomQuery("select Email from Profiles where Profile_ID=".$values["Profile_ID"]);

$data = db_fetch_array($rs);

$_SESSION["email"]=$data["Email"];


Now you can use $_SESSION["email"] anywhere in your code.
More info:

http://xlinesoft.com/phprunner/docs/process_record_values.htm

http://xlinesoft.com/phprunner/docs/customquery.htm

Z
Zaboor author 11/24/2013

Thank you for your help <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=73002&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' />