What does a colon before a literal in an SQL statement mean?

后端 未结 3 689
情话喂你
情话喂你 2020-12-19 07:14

What does it mean to use \":\" before a variable ?

For example, :userId in this code:

public function removeUser($userI         


        
3条回答
  •  甜味超标
    2020-12-19 07:23

    As thaidiotguy mentions, it's a character commenly used with prepared statements especially with PDO. In PDO the colon tells that the following is a named parameter.

提交回复
热议问题