A parte il valore di ritorno di mysql_select_db(), puoi sempre aggiungere IF NOT EXISTS allo statement CREATE DATABASE.