It really depends on whether the database has inherent SQL commands that will allow you to create a DB. In the case of MySQL or even PostGres, this should be possible. In Oracle it definately would not be an option.
There are some issues you could encounter though. First, the user you are logged in as under PHP may not have permissions to create a DB. Second, you may need to grant permissions to the DB for access before adding tables, etc.
Here is some code that I found worked:
$dbh = mysql_connect('localhost', 'root', '');
$result = mysql_query('create database testing', $dbh);
mysql_select_db('testing', $dbh);
....
Hope this helps.