Jump to content

skyrice

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

skyrice's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi there. I have a table that lists events along with their start time in a DATETIME field and their duration in two INT fields, one for hours and one for minutes. I'm trying to SELECT any events in this table that are happening in the future or are currently in progress. What I'm trying to do makes more sense if you look at this SQL query I'm making, but it doesn't work because it's not correct. How can I reform this query to do what I need? Thanks in advance. SELECT * FROM events WHERE date >= NOW() + INTERVAL events.hours HOUR + INVERVAL events.minutes MINUTE;
  2. I finally figured it out today. The people at my work have REGISTER_GLOBALS turned on. The session variable I was using has the same name as a non-session variable that is being assigned within the script and apparently it overwrites the $_SESSION variable of the same name as well. I didn't know that, nor did I know that REGISTER_GLOBALS was on... Bunch of bums over here... :-\
  3. Stuck that right underneath the $_SESSION variable assignment, then did print_r to make sure the right information was stored in the variable. Also did session_write_close() immediately after session_start() on the next page; same result. =( How is the variable changing when nothing is changing it?
  4. Just for fun I ran the basic concept code that I originally posted and it worked fine. I then went and rechecked to make sure that absolutely nothing was messing with my session variables and confirmed it; it's not hard to see. There are only 3 references to $_SESSION between both scripts. I don't see how this is happening... =(
  5. Hi there, I'm new here. Anyhow, here's my dilemma: <?php   session_start();   include 'database.inc';   $query = mysql_query("SELECT * FROM `table`");   $_SESSION['mysql_result_array'] = mysql_fetch_assoc($query);   print_r($_SESSION['mysql_result_array']);   /* This will print out:       Array (         [key] => value         [key] => value         [key] => value       )       As I would expect it to. */ ?> Now guess what happens when I get to another page and do this: <?php   session_start();   print_r($_SESSION['mysql_result_array']);   /* This prints out simply: Resource id #3 */ ?> I've tried even copying the array to a session variable key by key and it still gets destroyed when I move off the page. The reason I need this array in a session variable is because the next page is going to clear the data from the table, but I still need the data that used to be there in order to fill in some forms. The session variable is perfectly set to the right array when I'm on the page, and then when you move off of that page it gets destroyed. This is so frustrating... Nothing is touching the array btw...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.