Issue 1: Found in SQL statements can take $ number, such as $sql= "select * from table where id= $id"; When was this $id parsed?
The question 2:echo is the PHP essential Debug statement, under what circumstances can echo not play the role? Like in class, there's????
Reply to discussion (solution)
$sql = "SELECT * from table where id= $id";
The $id in the right string is parsed when the $sql to the left is assigned a value.
The main function of ECHO is to output the result of the operation, not debug
While debugging, you can use it to print some intermediate quantities to determine how the program is running.
The main debugging functions provided by PHP are:
Var_dump used to observe the type and value of a variable
Debug_zval_dump used to observe the reference of a variable
Debug_backtrace generates a backtracking that is used to observe the invocation of a function (method)
Learn about the 2 debug functions upstairs ...
PHP if the string in double quotation marks, the runtime will parse the variables and special symbols such as \ r \ n line-up and so on, the single quotation mark is not this function.
1. When the right character of a variable is enclosed in double quotation marks, you can parse the $ variable, if it is in single quotation marks. $str. "' Processing.
2.echo is used for output variables, debug please use Var_dump