lundi 19 février 2018

Problems with mysql code [duplicate]

This question already has an answer here:

I have problems when try go to my website,its nohing happens,and in error log comes this error,whats is wrong?

   Undefined variable: mysql in /home/heatfmlt/public_html/maincore.php on line 17



PHP Warning:  mysqli_query() expects parameter 1 to be mysqli, null given in /home/heatfmlt/public_html/maincore.php on line 17

My code is here:

/ 1. Create a database connection
$connection = mysqli_connect($dbhost , $dbuser , $dbpass);
if (!$connection) {
    die("Database connection failed: " . mysql_error());
}

// 2. Select a database to use 
$db_select = mysqli_select_db($connection, $dbname);
if (!$db_select) {
   $result = mysqli_query($mysql,$connection ) or die (mysqli_error($connection));
      $rws=  mysqli_fetch_array($query);
error_reporting("E ALL");``

Maybe you know whats is here wrong?




Aucun commentaire:

Enregistrer un commentaire