Re: help database creation....

From: Date: Thu, 11 Jan 2001 20:44:00 +0000
Subject: Re: help database creation....
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-34095@lists.php.net to get a copy of this message
better use 'root' user or create a user with enough privilage to create database Jesus Nava wrote:
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 (#34095) next »