Home >> FAQs/Tutorials >> SQL Server FAQ

SQL Server FAQ - Commonly Used ODBC Functions in PHP

By: FYIcenter.com

(Continued from previous topic...)

What Are Commonly Used ODBC Functions in PHP?

If you look at the PHP 5 manual, you will see a group of functions listed under the ODBC Functions (Unified) setion. The commonly used ODBC functions are:

  • odbc_connect Establish an OBDC connection.
  • odbc_data_source Returns information about a current connection.
  • odbc_close Close an ODBC connection.
  • odbc_exec Prepare and execute a SQL statement.
  • odbc_fetch_row Fetch a row - moving the pointer to the a new row in a result object.
  • odbc_result Get the value of a specific field from the current row of a result object.
  • odbc_fetch_array Fetch a result row as an associative array.
  • odbc_fetch_object Fetch a result row as an object.
  • odbc_num_rows Number of rows in a result.
  • odbc_field_name Get the name of a specified field index.
  • odbc_field_type Get the data type of a specified field index.
  • odbc_next_result Checks if multiple results are available.
  • odbc_free_result Free resources associated with a result object.
  • odbc_prepare Prepares a statement for execution.
  • odbc_execute Execute a prepared statement.
  • odbc_error Get the last error code.
  • odbc_errormsg Get the last error message.
  • odbc_tables Get the list of table names stored in a specific data source.
  • odbc_columns Lists the column names in specified tables.
  • odbc_autocommit Toggle autocommit behaviour.
  • odbc_commit Commit an ODBC transaction.
  • odbc_rollback Rollback a transaction.

(Continued on next topic...)

  1. What Are the Requirements to Use ODBC Connections in PHP Scripts?
  2. What Are Commonly Used ODBC Functions in PHP?
  3. How To Test ODBC DSN Connection Settings?
  4. How To Connect to a SQL Server using odbc_connect()?
  5. How To List All DSN Entries on Your Local Machine using odbc_data_source()?
  6. How To Execute a SQL Statement using odbc_exec()?
  7. How To Retrieve Error Messages using odbc_errormsg()?
  8. How To Turn Off Warning Messages during PHP Execution?
  9. How To Receive Returning Result from a Query?
  10. How To Loop through Result Set Objects using odbc_fetch_row()?
  11. How To Retrieve Field Values using odbc_result()?
  12. How To List All Tables in the Database using odbc_tables()?
  13. How To List All Columns in a Table using odbc_columns()?
  14. How To Create Prepared Statements using odbc_prepare()?

Related Articles:


Other Tutorials/FAQs:


Related Resources:


Selected Jobs: