version 2004
MySQL_NextRow (selectID) Integer
| Parameter | Type | Description | |
| selectID | Longint | Select ID returned by MySQL_Select | |
| Function result | Integer | 1 if moved to next row; 0 if no more rows exist |
Description
The MySQL_NextRow command advances through the rows of the result. It also needs to be called to move onto the first row of the result (if it exists).
The function returns 1 if it successfully moved to the next row; 0 if no more rows exist in the result.
selectID is a Longint returned by MySQL_Select.
Normally, you would call the method with a while loop, like:
While (0#MySQL_NextRow(selectID)) `...do stuff with content of the row... End while
Example
selID:=MySQL_Select(sonnID;"SELECT num, name, amount FROM clients WHERE last_order_date > '2005-05-31'" If(selID#0) While(0#MySQL_NextRow(selID)) MySQL_GetIntegerField(selID;0;$clientNum) MySQL_GetStringField(selID;1;$clientName) MySQL_GetRealField(selID;2;$clientAmount) End while Else `handle error here End if