Home >> FAQs/Tutorials >> SQL Server FAQ
SQL Server FAQ - PHP ODBC - Returning Result Set Objects
By: FYIcenter.com
(Continued from previous topic...)
PHP ODBC - What Is a Result Set Object Returned by odbc_exec()?
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.
(Continued on next topic...)
- PHP ODBC - How To Create a New Table?
- PHP ODBC - How To Insert Data into an Existing Table?
- PHP ODBC - How To Insert Multiple Rows with a subquery?
- PHP ODBC - How To Get the Number of Affected Rows?
- PHP ODBC - What Is a Result Set Object Returned by odbc_exec()?
- PHP ODBC - How To Loop through Returning Rows?
- PHP ODBC - How To Update Existing Rows in a Table?
- PHP ODBC - How To Delete Existing Rows in a Table?
- PHP ODBC - How To Include Text Values in SQL Statements?
- PHP ODBC - How To Include Date and Time Values in SQL Statements?
- PHP ODBC - How To Display a Past Time in Days, Hours and Minutes?
- PHP ODBC - How To Perform Key Word Search in Tables?
- PHP ODBC - How To Query Multiple Tables Jointly?
- PHP ODBC - How To Create an Identity Column?
|