T
|
tedwilder 10/12/2010 |
I need to query a table in my database to find a record where a column matches $_Session["UserID"]. My senario: User logs in and enters a record to the 'transactions' table, but has not yet saved it. Based upon the value of $_Session["UserID"], I want to do a query to the 'employees' table and return the value of the column 'EmailAddress' into a variable, from the record where the column 'FirstName' equals $_Session["UserID"]. Table: employees: ----------------------------- | FirstName | EmailAddress | ----------------------------- | Roger | roger@xyz.com | | Bob | bob@xyz.com | | John | john@xyz.com | ----------------------------- User 'bob' logs in, $_Session["UserID"] = 'bob'. Query is made to table 'employees' and variable $userEmailAddress = 'bob@xyz.com' is returned. Would someone kindly give me a snippet of PHP code to do this query and return the value in a variable? Thanks so much. Roger.
|
P
|
pcheesesteak author 10/12/2010 |
Thank you!!! |