note 4761 deleted from function.odbc-prepare by sniper
| From: | sniper@php.net | Date: | Thu, 28 Aug 2003 11:01:23 +0000 |
| Subject: | note 4761 deleted from function.odbc-prepare by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55216@lists.php.net to get a copy of this message | ||
Note Submitter: chien_ta_ching@ureach.com
----
Got an error from DB2's ODBC implementation (running on Solaris 260). Error message
"Warning: SQL error: [IBM][CLI Driver] CLI0005W Option value changed. SQLSTATE=01S02, SQL state
01S02 in SQLPrepare".
Replace odbc_prepare & odbc_execute with odbc_do as follows:
<?
// Using odbc_prepare & odbc_execute
$conn_id = odbc_connect('ODBC_DSN','USER','PASSWORD');
$stmt = odbc_prepare($conn_id,"select count * from test_table");
$exe_id = odbc_execute($stmt);
$answer = odbc_result($stmt, 1);
odbc_close($conn_id);
?>
<?
// Replace with odbc_do
$conn_id = odbc_connect('ODBC_DSN','USER','PASSWORD');
$exe_id = odbc_do($conn_id, "select count * from test_table");
$answer = odbc_result($exe_id, 1);
odbc_close($conn_id);
?>