--------------------------------------------------- | Date: 2003-02-17 00:19:07 | | Filename: crtdrpdb.php | | Author: detour@metalshell.com | | | | http://www.metalshell.com/ | --------------------------------------------------- <?php // listdbproc.php by detour@metalshell.com // // Creates and drops a database from mysql. // // http://www.metalshell.com/ // $dbuser = "user"; $dbpass = "pass"; $dbhost = "localhost"; echo('<html><head><title>Create Database</title></head><body>'); echo('<font face="arial" style="font-weight:bold">'); $dbid = mysql_connect($dbhost, $dbuser, $dbpass) or die("Error Connecting"); // Create the database. if (mysql_create_db("metal-newdb")) { echo('Database created.<br>'); echo('Now attempting to remove database...<br>'); // Drop the newly created database. if(mysql_drop_db("metal-newdb")) { echo('Database removed.'); } else { echo('Error: ' . mysql_error()); } } else { echo('Error: ' . mysql_error()); } mysql_close($dbid); echo('</body></html>'); ?>