PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$_SESSION['query'] = $query;
print_r($_SESSION);
//prints the correct everything
$query = mysql_query($query);
print_r($_SESSION);
//ALL OF A SUDDEN SESSION HAS CHANGED! WTF!
$_SESSION['queryb'] = $queryb
$query = mysql_query($queryb) or die(mysql_error());
//now i just use $query and all is well and happy.
what seams to happen is $_SESSION will follow the variable you set it to around the entire page starting from where you first set it so it will reset itself after you change the original value of the variable you set session to. it also seamed to have a effect if i named the session key to the same name as the variable that was changing but i can not put money on that, i just believe i tried that and it did not work. really strange, bewwwwwaaaarrrreeee! php 4.4.0 has this ability to ruin your night!
Do you have Register GlobalsOn in your php.ini? If Register Globals is enabled then any changes in the $query variable will also be reflected in the $_SESSIONS['query'] variable. So the result of the mysql_query will be in both the $query and $_SESSION['query'] variables. To stop this from happening you need to do what you indicated in your last post or disable Register Globals in the php.ini.
no register globals is not on. i know a bit better than that . it just happens with 4.4.0 though, timwv tested with 4.3.# and 5.0 and 4.4.0 and he was only able to duplicate the error with 4.4.0. i don't know whats up with this
Array ( [query] => shiz is mad )
Array ( [query] => shiz is mad )
So it looks like it works properly in PHP 4.3.11, then fails to work properly in 4.4.0, then works properly in 4.4.1.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.