I have retreived information from my database using SELECT * FROM 'table, this info is stored as $result.
I want to use the info stored as $result on the next page.
I have tried registering $result with a session (i.e. session_register("result") ) and after opening the session i have tried to access the info using mysql_fetch_array. This doesn't work.
Does this make sense?
What do i do?
Do i have to do something with $result before registering it with a session?
Please help a poor <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> off scouser!
putting info retreived from mysql on the next web page
Moderator: General Moderators
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
unfortunately $result does not contain the output of your query. it contains a resource identifier. it points to a temporary table created for the current script/session. once that script complets the temporary table is destroyed and the resource indentifier is no longer any good. without getting complicated the is no easy way to carry over a query from one page to another. best thing to do is re-query in the next page.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You could also save the result of the query into a proper array that you could carry over using sessions:
Mac
Code: Select all
$result_array = array();
while ($row = mysql_fetch_assoc($result)) {
$result_arrayї] = $row;
}