help database creation....

From: Date: Thu, 11 Jan 2001 19:33:46 +0000
Subject: help database creation....
Groups: php.general 
Request: Send a blank email to php-general+get-34075@lists.php.net to get a copy of this message
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>

« previous php.general (#34075) next »