Parse error in PHP code unexpected T

This question already has an answer here:

  • PHP parse/syntax errors; and how to solve them? 13 answers

  • 请以这种方式尝试你的代码,

    <?php
    $con=mysqli_connect("localhost","my_user","my_password","my_db");
    // Check connection
    if (mysqli_connect_errno())
      {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
      }
    
    $sql="SELECT id, email FROM users WHERE id = 1";
    $result=mysqli_query($con,$sql);
    
    
    // Associative array
    $row=mysqli_fetch_assoc($result);
    printf("id = %s (%s)n", $row['id'], gettype($row['id']));
    printf("email = %s (%s)n", $row['email'], gettype($row['email']));
    
    // Free result set
    mysqli_free_result($result);
    
    mysqli_close($con);
    ?>
    
    链接地址: http://www.djcxy.com/p/69606.html

    上一篇: 解析错误:语法错误,意外的'$ ind'(T

    下一篇: 在PHP代码意外的T中解析错误