Hi
I have a frustrating inconsistency in a web forum I've been writing.
I want to write session data to mysql (I have written my own session handling functions).
I call the function like this:
mysql_session_write($session, $user);
the function looks like this:
function mysql_session_write($session_id, $value)
{
$query="INSERT INTO Session VALUES ('$session_id', $expiration, '$value');
result= mysql_query($query);
}
when I look at the Sessions table in MySQL, the value for $value is blank.
When I put a print statement into the function, even if it is at the end and is simply
print "hello world";
the value in the sessions table for $value is no longer blank!
I have PHP version 4.0.5 on Slackware Linux.
Has anyone come across this problem before. Is this a bug or is it caused by my misunderstanding of PHP? I'm figuring it's a bug because $session_id is always fine, but $value isn't despite them both being passed across.
I have written out $value before it's passed to check that it exists, and it certainly does.
I hope someone out there can help me with this frustrating and puzzling problem.
thanks!