Search code examples
phpescapingmysqliprepared-statement

Enclosing prepared statement placeholders in single quotes


When creating a prepared statement in mysqli, should I enclose string value placeholders in single quotes?

I.e. should I write:

 INSERT INTO Person (Name) VALUES ('?')

or

 INSERT INTO Person (Name) VALUES (?)

Solution

  • INSERT INTO Person (Name) VALUES (?) 
    

    will work perfectly