lopes_andre Posted February 16, 2009 Share Posted February 16, 2009 Hi, I need to run all registers of a query one by one using PHP. Wich is the best way to do it? Using while? Sorry for my english. Best Regards, André. Quote Link to comment https://forums.phpfreaks.com/topic/145390-how-to-run-a-query-result-one-by-one/ Share on other sites More sharing options...
Mchl Posted February 16, 2009 Share Posted February 16, 2009 Please be more clear. Perhaps show an example, of what you want to do. Quote Link to comment https://forums.phpfreaks.com/topic/145390-how-to-run-a-query-result-one-by-one/#findComment-763261 Share on other sites More sharing options...
lopes_andre Posted February 16, 2009 Author Share Posted February 16, 2009 Hi, Sorry for my poor explanation... I need to do a Cursor like in oracle. I need to access all the values of a query, line by line... If I'am not clear, please tell me. Best Regards, André. Quote Link to comment https://forums.phpfreaks.com/topic/145390-how-to-run-a-query-result-one-by-one/#findComment-763306 Share on other sites More sharing options...
Mchl Posted February 16, 2009 Share Posted February 16, 2009 http://dev.mysql.com/doc/refman/5.0/en/cursors.html oh But in PHP you usually just do as it is shown in mysql_query example (Example #2: while ($row = mysql_fetch_assoc($result)) { ...) Quote Link to comment https://forums.phpfreaks.com/topic/145390-how-to-run-a-query-result-one-by-one/#findComment-763309 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.