MySQL_NextRow

4D - Documentation   Français   English   German   4D For MySQL, Command Theme List   4D For MySQL, Command Alphabetical List   Back   Previous   Next

version 2004


MySQL_NextRow (selectID) Integer

ParameterTypeDescription
selectIDLongintSelect ID returned by MySQL_Select
Function resultInteger1 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

4D - Documentation   Français   English   German   4D For MySQL, Command Theme List   4D For MySQL, Command Alphabetical List   Back   Previous   Next