pdo:insert_statements
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
pdo:insert_statements [2016/10/14 09:28] – peter | pdo:insert_statements [2020/07/15 09:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 8: | Line 8: | ||
</ | </ | ||
- | + | ===== Preparing Statements using SQL functions | |
- | You may ask how do you use SQL functions | + | |
<code php> | <code php> | ||
Line 62: | Line 61: | ||
+ | ===== Executing prepared statements in a loop ===== | ||
+ | |||
+ | Prepared statements excel in being called multiple times in a row with different values. | ||
+ | |||
+ | Typically this is done by binding parameters with **bindParam**. | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | $values = array(' | ||
+ | $name = ''; | ||
+ | $stmt = $db-> | ||
+ | $stmt-> | ||
+ | foreach($values as $name) { | ||
+ | $stmt-> | ||
+ | } | ||
+ | </ |
pdo/insert_statements.1476437309.txt.gz · Last modified: 2020/07/15 09:30 (external edit)