This topic is locked

Adding data to e-mail fro other table

9/11/2009 8:47:09 AM
PHPRunner General questions
M
mmponline author

I need to add data from another table into an event when I send a confirmation e-mail.
Eg.

I have a Client table and Bookings.

When I add (or edit) a booking, I want to include certain fields from the Clients table as well. How do I manage this? I know it's some session to be used, but I'm stuck.

J
Jane 9/14/2009

Hi,
you can select values from user table using $_SESSION["UserID"] variable.

Here is a sample:

global $dal;

$rstmp = $dal->UsersTableName->Query("UserName='".$_SESSION["UserID"]."'","");

$datatmp = db_fetch_array($rstmp);

M
Mandy 9/14/2009



Hi,
you can select values from user table using $_SESSION["UserID"] variable.

Here is a sample:


Sorry to be a little off-topic, but can someone please explain the need for the ,"" at the end?

Also, I don't understand the need for the opening and closing ' and the extra " ie ."'"
Thanks and excuse my ignorance.
Mandy

J
Jane 9/15/2009

Hi,
I recommend you to check this article:

http://www.xlinesoft.com/phprunner/docs/data_access_layer.htm
Also you need to add single quotes around text values ($_SESION["UserID"] for example) in the SQL queries.