Does anyone know the meaning behind this php error message?

后端 未结 6 1968
别跟我提以往
别跟我提以往 2021-01-22 20:47

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING is the message. It came up from this line of code:

<         


        
6条回答
  •  星月不相逢
    2021-01-22 21:27

    Use:

    $query = sprintf("SELECT u.* 
                        FROM USERS u
                       WHERE u.user_name = '%s' 
                         AND u.password = '%s' 
                         AND u.user_type = '%s' ",
                       mysql_real_escape_string($_POST['user_name']),
                       mysql_real_escape_string($_POST['password']),
                       mysql_real_escape_string($_POST['user_type']) );
    
    $result = mysql_query($query);
    

    Reference

    • sprintf

提交回复
热议问题