PHP.nl

odbc_execute

odbc_execute

Execute a prepared statement

bool **odbc_execute** Odbc\Result $statement array $params

Executes a statement prepared with . odbc_prepare

statement odbc.result.object from . odbc_prepare

params Parameters in will be substituted for placeholders in the prepared statement in order. Elements of this array will be converted to strings by calling this function. params

   Any parameters in  which
   start and end with single quotes will be taken as the name of a
   file to read and send to the database server as the data for the
   appropriate placeholder.
  `params`


   If you wish to store a string which actually begins and ends with
   single quotes, you must add a space or other non-single-quote character
   to the beginning or end of the parameter, which will prevent the
   parameter from being taken as a file name. If this is not an option,
   then you must use another mechanism to store the string, such as
   executing the query directly with ).
  `odbc_exec`

return.success

Voorbeeld: and example

 In the following code,  will only be
 true if all three parameters to myproc are IN parameters:
`$success`
<?php
$a = 1;
$b = 2;
$c = 3;
$stmt    = odbc_prepare($conn, 'CALL myproc(?,?,?)');
$success = odbc_execute($stmt, array($a, $b, $c));
?>

If you need to call a stored procedure using INOUT or OUT parameters, the recommended workaround is to use a native extension for your database (for example, for Oracle). oci8

odbc_prepare