The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › Other › meaning =: in SQL
Could anyone tell me what’s the meaning of =: in SQL
please give me an example!
thanx in advance ☺
Do you mean something like named parameter in PDO?
Here is an example:
/* Execute a prepared statement by passing an array of values */
$sql = 'SELECT name, colour, calories
WHERE calories < :calories AND colour = :colour';
$sth = $dbh->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
$sth->execute(array(':calories' => 150, ':colour' => 'red'));
$red = $sth->fetchAll();
$sth->execute(array(':calories' => 175, ':colour' => 'yellow'));
$yellow = $sth->fetchAll();
See also PHP Manual for more information.
not in PDO i saw it in mysql
SELECT * FROM tbl WHERE user =: user;
it’s meaning = or what !!!