nuglobe
-
Posts
2 -
Joined
-
Last visited
Never
Posts posted by nuglobe
-
-
Alright so this is the entry that was stored in the database:
a:1:{s:6:"Andrew";s:17:"me@gmail.com";}
Here is the function that serializes it. Note - $_SESSION['stateEmails'] is passed through as the request array.
[code]function submit_request($uID, $requestArray){
$players = serialize($requestArray);
$status = 1;
$query = "INSERT INTO requests (uID, playersID, status) VALUES ('$uID', '$players', '$status')";
mysql_query ($query) or die ('Could not submit request!.');
}[/code]
Here is the code that creates the array.
[code]$_SESSION['stateEmails'][$rowprof['uFName']] = $rowprof['uEmail'];[/code]
Its in a loop, so there cool be more to it then the one posted at the top.
And finally here is the function I am trying to use to pull from the database, unserialize and display.
[code]
function get_open_requests($uID)
{
$status = 1;
$query = "SELECT playersID FROM requests WHERE uID = $uID AND status = $status";
$pull = mysql_query($query);
$players = unserialize($pull);
print_r($players);
}[/code]
What am I doing wrong?
Unserialize returning false?
in PHP Coding Help
Posted