Expressions $mysqli->close(); ?> Assembling an SQL statement in this fashion is sometimes known as “Dynamic SQL” . This section lists the grammar rules that expressions must follow in MySQL and provides additional information about the types of terms that may appear in expressions. The following grammar rules define expression syntax in MySQL. The grammar shown here is based on that given in the  sql/sql_yacc.yy  file of MySQL source distributions. For additional information about some of the expression terms, see Expression Term Notes. expr : expr  OR  expr |  expr  ||  expr |  expr  XOR  expr |  expr  AND  expr |  expr  &&  expr | NOT  expr | !  expr |  boolean_primary  IS [NOT] {TRUE | FALSE | UNKNOWN} |  boolean_primary boolean_primary : boolean_primary  IS [NOT] NULL |  boolean_primary  <=>  predicate |  boolean_primary comparison_operator predicate |  boolean_primary comparison_operator  {ALL | ANY} ( subquery ) |  predicate comparison_operator : = | >= | > | <= | < | <> | != predicate : bit_expr  [NOT] IN ( subquery ) |  bit_expr  [NOT] IN ( expr  [,  expr ] ...) |  bit_expr  [NOT] BETWEEN  bit_expr  AND  predicate |  bit_expr  SOUNDS LIKE  bit_expr |  bit_expr  [NOT] LIKE  simple_expr  [ESCAPE  simple_expr ] |  bit_expr  [NOT] REGEXP  bit_expr |  bit_expr bit_expr : bit_expr  |  bit_expr |  bit_expr  &  bit_expr |  bit_expr  <<  bit_expr |  bit_expr  >>  bit_expr |  bit_expr  +  bit_expr |  bit_expr  -  bit_expr |  bit_expr  *  bit_expr |  bit_expr  /  bit_expr |  bit_expr  DIV  bit_expr |  bit_expr  MOD  bit_expr 1915 Expression Syntax 9.5 Expressions •Temporal Intervals •Expression Term Notes •Expression Syntax