Skip to content

Commit 744feee

Browse files
committed
Update query binding docs. Fixes #781
1 parent 40821d0 commit 744feee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

user_guide_src/source/database/queries.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,15 @@ Instead of using the question mark to mark the location of the bound values,
168168
you can name the bindings, allowing the keys of the values passed in to match
169169
placeholders in the query::
170170

171-
$sql = "SELECT * FROM some_table WHERE id = :id AND status = :status AND author = :name";
171+
$sql = "SELECT * FROM some_table WHERE id = :id: AND status = :status: AND author = :name:";
172172
$db->query($sql, [
173173
'id' => 3,
174174
'status' => 'live',
175175
'name' => 'Rick'
176176
]);
177177

178+
.. note:: Each name in the query MUST be surrounded by colons.
179+
178180
***************
179181
Handling Errors
180182
***************

0 commit comments

Comments
 (0)