v5:reference:connection:prepare
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
reference:prepare [2015/12/01 02:41] – created mnewnham | v5:reference:connection:prepare [2016/11/02 12:42] – [prepare] fix broken link for prepareSp 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 feature compatibility matrix |
- | * | + | </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> | ||
+ | /* | ||
+ | | ||
+ | */ | ||
+ | |||
+ | $handle | ||
+ | |||
+ | $bindVariables = array(0=>100); | ||
+ | |||
+ | /* | ||
+ | * Send an array to execute | ||
+ | */ | ||
+ | $result = $db->execute(array($handle,$bindVariables)); | ||
+ | </code> | ||
+ | |||
+ | For compatibility purposes, if the database does not support prepared statements, the SQL statement is returned into the '' |
v5/reference/connection/prepare.txt · Last modified: 2019/08/09 15:42 by dregad