odbc_exec

resource odbc_exec(resource conn, string query) 

Executes an ODBC query.

Returns:

Result identifier; FALSE on error

Description:

Executes the SQL statement contained inside the query string. The database to be queried is specified by the connection ID. This is different in functionality from odbc_execute(), which is used to execute multiple SQL statements.

Version:

Existing since version 3.0.6

Example:

Execute SQL
$db = odbc_connect("DSN","user","pass"); 
$result = odbc_exec($db,"SELECT FirstName, LastName FROM Employees 
 ORDER BY LastName"); 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.