PHP ODBC - Returning Result Set Objects

Q

PHP ODBC - What Is a Result Set Object Returned by odbc_exec()?

✍: Guest

A

A result set object is a logical representation of data rows returned by odbc_exec() function on SELECT statements. Every result set object has an internal pointer used to identify the current row in the result set. Once you get a result set object, you can use the following functions to retrieve detail information:

  • odbc_free_result($res) - Closes this result set object.
  • odbc_num_rows($res) - Returns the number rows in the result set.
  • odbc_num_fields($res) - Returns the number fields in the result set.
  • odbc_fetch_row($res) - Moving the internal pointer to the next row.
  • odbc_fetch_array($res) - Returns an array contains the next row indexed by filed names. The internal pointer is moved to the next row too.
  • odbc_fetch_object($res) - Returns an object representing the next row. The internal pointer is moved to the next row too.
  • odbc_field_len($res, $1) - Returns an array contains lengths of all fields in the last row returned.
  • odbc_field_name($res, $i) - Returns the name of the field of the specified index.
  • odbc_result($i) - Returns the value of the field specified by its position from the current row.
  • odbc_result($name) - Returns the value of the field specified by its name from the current row.

 

PHP ODBC - odbc_fetch_array() - Looping through Returning Rows

PHP ODBC - odbc_num_rows() - Number of Affected Rows

SQL Server FAQs - PHP ODBC Functions - Managing Tables and Data Rows

⇑⇑ SQL Server Connection Tutorials

2024-05-29, 1334🔥, 0💬