Tags
PHP
Asked 5 years ago
14 Nov 2019
Views 4028
Phpworker

Phpworker posted

PHP Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in


$conn = mysqli_connect($host,$user,$password)
	function selectDB($conn) {
		mysqli_select_db($conn,$this->database);
	}

i getting following error in above code

PHP Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in
Mitul Dabhi

Mitul Dabhi
answered Nov 30 '-1 00:00

mysqli_select_db($connection,$dbname) should have two argument , first for Specifies the MySQL connection to use and second is database name


PHP Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in



says that you providing string value instead of connection request object
Post Answer