View Full Version : Setting $_SESSION Variables
Kevin373660
06-08-2009, 03:29 PM
I have the $_SESSION['kidID'] set but I am not sure how to write the code to put the"value" of into or = to the $row_WADAtbl_members['kidID']. I only know how to set a session variable as a fixed integer or 'string.' Like after the session is started with $_SESSION['kidID'] = 1. I can also echo both on the page to confirm their values. In this case both are integers. I get totally lost with php.manual. Please can someone help me out? It would be a greatly appreciated. Thank you.
Ray Borduin
06-08-2009, 04:05 PM
You can set a session variable from a recordset row like:
$_SESSION['kidID'] = $row_WADAtbl_members['kidID'];
You can use it to insert into the database with DataAssist, or you can use it in your SQL parameters to filter results.
You can certainly echo both to the page to confirm their values as well, but remember you need session_start() somewhere above where you first start using session variables on the page.
Kevin373660
06-08-2009, 04:46 PM
Thank you Ray! It is great to know the proper syntax. Your help is always appreciated.
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.