MySQL/PHP: How to get one record at a time?

jumpingrightin

New member
In MySQL using PHP, most of the routines show you do a SELECT and get the entire query returned and stored in a variable like $results. The problem is, the MySQL database I'm using is huge and PHP can't handle holding it all in memory. Since I have to read one row (read) at a time so I can work with it in PHP, I tried using "LIMIT 1", but while this returns one record -- I don't know how to make it advance to the next row (record) in MySQL. How can I retrieve just one record at a time from a MySQL database and have it advance to the next record? The Columns names have numbers that don't start with 1, so I can't do a WHERE id=1, or id=10 since those values for those id columns might not exist. Thanks!
Oh, so it's a pointer! I was confused because when using an XML function in PHP it was loading the entire XML file into memory.
 
Back
Top