note 110472 added to function.odbc-execute
| From: | MarcoNapetti | Date: | Thu, 25 Oct 2012 10:18:45 +0000 |
| Subject: | note 110472 added to function.odbc-execute | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191543@lists.php.net to get a copy of this message | ||
To use prepared with select queries, the right way is:
<?PHP
$rConnection = odbc_connect('AS400', 'QSECOFR', 'QSECOFR');
if($rConnection === false) {
throw new ErrorException(odbc_errormsg());
}
$rResult = odbc_prepare($rConnection, 'SELECT * FROM KMNSH00F WHERE SHTMST > ?');
if($rResult === false) {
throw new ErrorException(odbc_errormsg());
}
if(odbc_execute($rResult, array('0001-01-01 00:00:00.000000')) === false) {
throw new ErrorException(odbc_errormsg());
}
odbc_result_all($rResult);
odbc_free_result($rResult);
odbc_close($rConnection);
?>
----
Server IP: 94.141.21.201
Probable Submitter: 82.193.16.186
----
Manual Page -- http://www.php.net/manual/en/function.odbc-execute.php
Edit -- https://master.php.net/note/edit/110472
Del: integrated -- https://master.php.net/note/delete/110472/integrated
Del: useless -- https://master.php.net/note/delete/110472/useless
Del: bad code -- https://master.php.net/note/delete/110472/bad+code
Del: spam -- https://master.php.net/note/delete/110472/spam
Del: non-english -- https://master.php.net/note/delete/110472/non-english
Del: in docs -- https://master.php.net/note/delete/110472/in+docs
Del: other reasons-- https://master.php.net/note/delete/110472
Reject -- https://master.php.net/note/reject/110472
Search -- https://master.php.net/manage/user-notes.php