0

Php error : Unknown database while connection

Getting this error when i am using variable which have the name of the database on the place of database name : $con=mysqli("localhost" , "root" , " " , $databaseName); Not getting the error when i am typing the name of the database : $con=mysqli("localhost" , "root" , " ", "praveensoni");

24th Nov 2018, 8:56 PM
Praveen Soni
Praveen Soni - avatar
2 Réponses
0
Since we cannot see the full code, im gonna assume your variable is not seen by the function, pay attention to the scope and where you gave it a value before using it
25th Nov 2018, 12:29 PM
Dominique Abou Samah
Dominique Abou Samah - avatar
0
Dominique Abou Samah its showing the variable value that contains the name of the database. I am not able to show you the picture of the error here since Sololearn doesn't give this facility.
25th Nov 2018, 7:11 PM
Praveen Soni
Praveen Soni - avatar