hansman Posted July 9, 2008 Share Posted July 9, 2008 Hello, I am brand new to this sessions thing. I want to have a session so i can carry the database table name across severl pages to run a sql query. I have my pull donw menu that will select what database to select with the variable is "id". On the first page after the for i have this <?php session_start(); // start up your PHP session! $_SESSION['id'] = $_POST['id']; ?> is this correct? and how will i use the session on other pages? Link to comment https://forums.phpfreaks.com/topic/113956-sessions-help/ Share on other sites More sharing options...
revraz Posted July 9, 2008 Share Posted July 9, 2008 That is correct, and on your other pages, you do the same. <?php session_start(); // start up your PHP session! echo $_SESSION['id']; ?> Link to comment https://forums.phpfreaks.com/topic/113956-sessions-help/#findComment-585659 Share on other sites More sharing options...
hansman Posted July 9, 2008 Author Share Posted July 9, 2008 so can i use that in a SQL Query like this? SELECT * FROM $_SESSION['id'] Link to comment https://forums.phpfreaks.com/topic/113956-sessions-help/#findComment-585668 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.