PHP mysqli_query() expects parameter 1 to be mysqli, object given in [duplicate]
问题 This question already has answers here : mysqli_query() expects parameter 1 to be mysqli, object given (3 answers) Closed 8 days ago . 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