i made a wrapper class for mysqli with the following syntax:
class mydb extends mysqli
{
....
}
i'm creating instances like the following:
$conn = new mydb($host $username , $pass, $dbname);
i'm wondering - how can i access $dbname
from inside the class?
i'm looking for an mysqli equivalent for the mysql_db_name()
function.
You can use this SQL query from your own class:
SELECT database() AS the_db
That should show you the current DB you have selected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With