mysqli_select_db() expects exactly 2 parameters, 1 given in

permisi apa yang salah ya ? function sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true) { $this->persistency = $persistency; $this->user = $sqluser; $this->password = $sqlpassword; $this->server = $sqlserver; $this->dbname = $database;

$this->db_connect_id = ($this->persistency) ? mysqli_pconnect($this->server, $this->user, $this->password) : mysqli_connect($this->server, $this->user, $this->password);

if( $this->db_connect_id ) { if( $database != "" ) { $this->dbname = $database; $dbselect = mysqli_select_db($this->dbname);

if( !$dbselect ) { mysqli_close($this->db_connect_id); $this->db_connect_id = $dbselect; } }

return $this->db_connect_id; } else { return false; } }

avatar kerangajaib75
@kerangajaib75

1 Kontribusi 0 Poin

Diperbarui 6 tahun yang lalu

1 Jawaban:

sesuai tulsan di errornnya "expects exactly 2 parameters, 1 given in"

artinya fungsi mysqli_select_db butuh 2 parameter, tapi cuma satu yang dikasih paramter pertama koneksinya: $this->db_connect_id parameter kedua nama databasenya

avatar hilmanski
@hilmanski

2686 Kontribusi 2135 Poin

Dipost 6 tahun yang lalu

Login untuk ikut Jawaban