I'm using wamp server for development.
Using below php code to get all db's
<?php
$txt = "Hello world!";
echo $txt;
echo "<br><br><br>";
$mysqli = new mysqli('localhost', 'root', '');
if ($mysqli->connect_errno) {
trigger_error('query failed: '.$mysqli->connect_error, E_USER_ERROR);
}
$result = $mysqli->query('SHOW databases')
or trigger_error('connect failed: '.join(',', $mysqli->error_list), E_USER_ERROR);
foreach( $result as $row ) {
echo join(', ', $row), "<br />\r\n";
}
?>
Result i'm getting in browser
when i login to php myadmin i can see below db's
In Phpmyadmin: mydb and test db's are not there
IN php: testdb is not there
How can I connect test db using php ?
getting Connection failed: Unknown database 'testdb' error when i try to connect