I have this code
class Db_conn {
private $sn = 'localhost';
private $un = 'root';
private $up = '';
public function connect(string $db_n){
$conn = mysqli_connect($this->sn, $this->un, $this->up, $db_n);
if (!$conn) {
die("Připojení se nezdařilo: " . mysqli_error($conn));
} else {
return $conn;
}
}
}
And this code
public function update($query){
$dbconn = new Db_conn();
if (mysqli_query($dbconn, $query)) {
return True;
} else {
return False;
}
}
And on this line if (mysqli_query($dbconn, $query)) {
it says there is an error.
Warning: mysqli_query() expects parameter 1 to be mysqli, object given in D:\xampp\htdocs\purkiada2\content\Db_parser.inc.php on line 21