What does a colon in a MySQL statement mean?

Source: Internet
Author: User
What does a colon in a MySQL statement mean?


Reply to discussion (solution)

$db->bandvars (); Passing values
echo $check _query; Will know.

Can look at the brochure PDO class

 
  Prepare (' SELECT name, colour, calories from    fruit    

There is no other meaning in the notation, so that it differs from the syntax component of SQL
The Bindvars method associates the defined symbol with the actual variable.

Example #1 Execute A prepared statement with named placeholders
 
   prepare (' SELECT name, colour, calories from    F Ruit    WHERE calories <: calories and colour =: Colour '); $sth->bindparam (': Calories ', $calories, PDO::P aram_int ); $sth->bindparam (': Colour ', $colour, PDO::P aram_str,); $sth->execute ();? >example #2 Execute A prepared statement with question mark placeholders
 
   prepare (' SELECT name, colour, calorie s from    fruit    WHERE calories <? and colour =? '); $sth->bindparam (1, $calories, PDO::P aram_int), $sth->bindparam (2, $colour, PDO::P aram_str, N); $sth Execute ();? >

Big God, the following MySQL statement is used to query the ranking, in MySQL can be executed, but the S2SH framework is not, can you point it out?
Select T.*, @rownum: = @rownum +1 as RowNum
From (SELECT sum (Yjb_yji) as total,yyryusername,yjb_yyry_id
From YJB where month (createtime) =month (now ()) and year (Createtime) =year (now ())
Group BY yjb_yyry_id ORDER BY total desc) T, (SELECT @rownum: =0) r

Reported this bug:org.hibernate.QueryException:Space is not allowed after parameter prefix ': '

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.