odbc_prepare

resource odbc_prepare(resource conn, int query) 

Prepares a SQL query.

Returns:

FALSE on error

Description:

Prepares a SQL statement for execution but doesn’t execute the statement. A result identifier is returned, which can be passed to odbc_execute(), which then executes the SQL statement.

Version:

Existing since version 3.0.6

Example:

Prepare a SQL statement
$db = odbc_connect("DSN","user","pass"); 
$result = odbc_prepare($db,"SELECT * FROM Employees ORDER BY LastName"); 
odbc_execute($result); 

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.