- This topic is empty.
- The forum ‘Other’ is closed to new topics and replies.
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 !!!