Then I write it like this: you can execute it without a colon.
Then I write:
It can also be executed without a colon.
Reply content:
Then I write:
It can also be executed without a colon.
There are two methods for executing the query when the PDO pre-processing is bound to a parameter:
One is "question mark placeholder" (from left to right, with one-to-one correspondence ):
$ Stmt = $ db-> prepare ('update posts SET post_title = ?, Post_content =? WHERE id =? '); $ Stmt-> execute (array ($ title, $ content, $ id); // All values are treated as PDO: PARAM_STR
One is "nameplaceholder ":
$ Stmt = $ db-> prepare ('update posts SET post_title =: title, post_content =: content WHERE id =: ID'); $ stmt-> execute (array (': title '=> $ title,': content' => $ content, ': ID' => $ id); // All values are treated as PDO: PARAM_STR
Which of the following methods can be used to omit the colon? however, we recommend that you do more insurance as described in the official document.