adspace
How can get all database name using Php and Sql?
Answer Posted / Vipul Negi
Answer: To get all the database names using PHP and MySQL, you can use the following code:nn```phpn$connection = new mysqli('localhost', 'username', 'password', 'database_name');nif ($connection->connect_error) {n die("Connection failed: " . $connection->connect_error);n}n$result = $connection->query('SHOW DATABASES');nwhile($row = $result->fetch_assoc()) {n echo $row['Database'] . "n";n}n$connection->close();n```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category