I have an SQL query which returns values to an array (which works, and prints into a table etc..) but i want to also store the results of the query into cookies so that i can use them on another page later.
I tried doing it like this with an index variable dynamically creating cookies for each result produced and assigning a value to it.
When I try echoing the cookie, nothing happens...
Code: Select all
while($row = mysql_fetch_array($result))
{
setcookie("Username".$i, $row['Username'], time()+3600);
setcookie("FirstName".$i, $row['FirstName'], time()+3600);
setcookie("Surname".$i, $row['Surname'], time()+3600);
setcookie("School".$i, $row['School'], time()+3600);
setcookie("Framework".$i, $row['Framework'], time()+3600);
setcookie("Account".$i, $row['Account'], time()+3600);
setcookie("Banned".$i, $row['Banned'], time()+3600);
$i++;
}
echo "<p>";
echo $_COOKIE["Username0"];
echo "</p>";