Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other meaning =: in SQL

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33900
    The-Marshal
    Member

    Hi everyone

    Could anyone tell me what’s the meaning of    =:    in SQL

    please give me an example!

    thanx in advance ☺

    #84984
    ddliu
    Member

    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
    FROM fruit
    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.

    #85028
    The-Marshal
    Member

    Thanx ddliu

    not in PDO i saw it in mysql

    ex


    SELECT * FROM tbl WHERE user =: user;

    it’s meaning = or what !!!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Other’ is closed to new topics and replies.