Hi everybody!!!
I want to create a new database using a form to take the name of the database. For 
some reason I get "Couldn't create database". Can some body tell me what I am doing 
wrong...

<?
if (!$dname)
{
      header("Location: http://localhost/db_createdb.html");
      exit;
}
$db_name = $dname;
$connect = @mysql_connect("localhost", "jnava", "jnava77") or die("Couldn't connect");
$result = mysql_create_db($db_name, $connect) or die("Couldn't create database.");

if ($result)
{
     $msg = "<P>Database has been created!</P>";
}
?>
<HTML>
<HEAD>
<TITLE>Create a MySQL Database</TITLE>
</HEAD>
<BODY>
<? echo "$msg"; ?>
<? echo "$connect"; ?>
</BODY>
</HTML>

Reply via email to