0

I am getting this error message

Warning: mysqli::query(): Couldn't fetch mysqli in C:\xampp\htdocs\Internal Evaluation Guide\action4.php on line 176

The connection with the database is ok

for ($i =1; $i <=$s; $i++){
    //echo $idb[$i];
    echo "<br>";
    if ($kind1 == 'braxyxronia'){
        $d[$i] = $_POST["delb".$i];
        if ($d[$i]=="del"){
            $quer_del="Delete from apotelesmata where id='$idb[$i]' and kind='$kind1'";
            //echo $quer_del; the string is ok
            $result = $db->query($quer_del); //line 176
        }
    //$id=$i;
    }
}
Dharman
  • 30,962
  • 25
  • 85
  • 135
  • Is the connection really still open? http://www.php.net//manual/en/mysqli.query.php#103422 Make sure you have not called `$db->close()` somewhere. – Michael Berkowski Jun 24 '14 at 13:45
  • Does this answer your question? [mysqli::query(): Couldn't fetch mysqli](https://stackoverflow.com/questions/19937880/mysqliquery-couldnt-fetch-mysqli) – Dharman Oct 06 '21 at 14:17

1 Answers1

0

You are using mysql to fetch the result but the error is showing that you are using mysqli. Make sure which extension are you using. Use

mysqli_query("your link", "you sql query");
Dharman
  • 30,962
  • 25
  • 85
  • 135
stacky
  • 108
  • 1
  • 15