What does this mean?
Posted
by
LeonixSolutions
on Stack Overflow
See other posts from Stack Overflow
or by LeonixSolutions
Published on 2011-01-08T06:39:28Z
Indexed on
2011/01/08
6:53 UTC
Read the original article
Hit count: 189
php
I found this in some code examples while googling :
$sql = 'INSERT INTO users (username,passwordHash) VALUES (?,?)';
it's new to me, but I would guess that it a substitution method and equivalent to
$sql = "INSERT INTO users (username,passwordHash) VALUES ($username,$passwordHash)";`
or
$sql = 'INSERT INTO users (username,passwordHash) VALUES (' . $username . ',' . $passwordHash . ')';`
would that be correct? Is it an actual PHP syntax, or was he just trying to simplify his example?
© Stack Overflow or respective owner