jim.davidson Posted December 30, 2009 Share Posted December 30, 2009 I have a form that the user selects a date and member id. I then update a table with that info and store the date to a session variable for use on another page. Everything works except the date doesn't store to the session variable. I can't see what I'm doing wrong. Heres the code, any help will be greatly appreciated! if( is_array($member)){ $ddate = explode('/', $_POST['meeting_date']); $sql_meeting_date = "$ddate[2]-$ddate[0]-$ddate[1]"; $_SESSION['meeting_date'] = $sql_meeting_date; while (list ($key, $val) = each ($member)) { $insertSQL = sprintf("INSERT INTO meetings (member_id, date) VALUES (%s, %s)", GetSQLValueString($val, "int"), GetSQLValueString($sql_meeting_date, "date")); mysql_select_db($database_myvfd, $myvfd); $Result1 = mysql_query($insertSQL, $myvfd) or die(mysql_error()); } } Link to comment https://forums.phpfreaks.com/topic/186717-having-a-problem-with-a-storing-a-variable-to-a-session/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 30, 2009 Share Posted December 30, 2009 Do you have a session_start statement before any output on all pages that set or use a session variable? Link to comment https://forums.phpfreaks.com/topic/186717-having-a-problem-with-a-storing-a-variable-to-a-session/#findComment-986060 Share on other sites More sharing options...
jim.davidson Posted December 30, 2009 Author Share Posted December 30, 2009 I knew it was going to be some stupid mistake. Would help to start the session! Thank you so much, your help was appreciated!! Link to comment https://forums.phpfreaks.com/topic/186717-having-a-problem-with-a-storing-a-variable-to-a-session/#findComment-986062 Share on other sites More sharing options...
jim.davidson Posted December 30, 2009 Author Share Posted December 30, 2009 Thanks all Link to comment https://forums.phpfreaks.com/topic/186717-having-a-problem-with-a-storing-a-variable-to-a-session/#findComment-986063 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.