Help me understand the parameters for mysqli_query.



  • Help me get this straight! I write a simple sniphfer for training purposes, which should record user data (ip, customer data, time) in Mysql database. But in the next section of the code.

    $query = mysqli_query ($dblink, "INSERT INTO 'data' VALUES ('ip', 'usera', 'date')"); 
    mysqli_query ($query, $dblink); 
    mysqli_close ($dblink); 
    

    There's a mistake.

    Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in C:\OpenServer\domains\php.loc\include\sniff.php on line 14
    

    The variable $dblink is a connection to the worst, and it's in another file. The OBD is successfully connected, but this error occurs when the crypt starts.



  • Right after the line, make the switching error.

    echo mysqli_connect_error();
    

    PS And show the whole code from the line to mysqli_close, or at least the connecting line itself.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2