View Single Post
09-22-2009, 10:54 PM
#2
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

You could use a query on the magic INFORMATION_SCHEMA database to get the number (see below), or just count the number of rows returned from SHOW DATABASES.

Example Query:
Code:
SELECT COUNT(SCHEMA_NAME) AS `Databases` FROM INFORMATION_SCHEMA.SCHEMATA;
Example Returns:
Code:
+-----------+
| Databases |
+-----------+
|         2 | 
+-----------+

Reply With Quote