ts10 wrote:Also, I used PHP4 so I'm not sure how different that is.
I was programming in PHP eight years ago, and I remember PHP 4's release and how it coincided with our company's breaking up for Christmas 2000. That's why I thought you meant PHP 3.
ts10 wrote:What happens is there will only be on row in the DB that matches the query
Then you don't need a loop.
How could it be that the first print_r works yet the second doesn't?
Now that I don't know; unless you're managing to trigger a PHP bug that has never affected anyone else (unlikely, in such a simple program), both of those print_r() statements should produce the same result. Since this is happening on one page, the session is irrelevant. Even if you are storing the data in the session (have you checked the directory where your session data is being stored to see?) when you refresh will be replacing it with the results of running the query again.