v5:reference:connection:prepare
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| reference:prepare [2015/12/01 02:41] – created mnewnham | v5:reference:connection:prepare [2019/08/09 15:42] (current) – [Usage] Fix execute call per https://github.com/ADOdb/ADOdb/issues/543 dregad | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | /** | + | ====== prepare ====== |
| - | * Should | + | ~~NOTOC~~ |
| - | * For databases that do not support | + | <WRAP info> |
| - | * compatibility with databases that do not support prepare: | + | Support for this function is limited. See the [[v5: |
| - | * | + | </WRAP> |
| - | * | + | <WRAP right box 250px> |
| - | | + | == See Also == |
| - | * | + | [[v5: |
| - | * | + | [[v5: |
| - | * @param sql SQL | + | == Syntax == |
| - | * | + | |
| - | * @return return FALSE, or the prepared | + | string $sql |
| - | * if the database does not support prepare. | + | ) |
| - | * | + | |
| - | */ | + | </ |
| + | |||
| + | ===== Description ===== | ||
| + | The method '' | ||
| + | * If the database supports prepared statements | ||
| + | * If the database supports prepared statements and the statement is invalid the method returns false. | ||
| + | * If the database does not support | ||
| + | |||
| + | ------------------------------------- | ||
| + | ===== Usage ===== | ||
| + | <code php> | ||
| + | /* | ||
| + | * Connection to Oracle database | ||
| + | */ | ||
| + | |||
| + | $handle | ||
| + | |||
| + | $bindVariables = array(0=>100); | ||
| + | |||
| + | /* | ||
| + | * Execute the prepared statement | ||
| + | */ | ||
| + | $result = $db->execute($handle, $bindVariables); | ||
| + | </ | ||
| + | |||
| + | For compatibility purposes, if the database does not support prepared statements, the SQL statement is returned into the '' | ||
v5/reference/connection/prepare.1448934108.txt.gz · Last modified: (external edit)
