Re: help database creation....
| From: | Ignacio Vazquez-Abrams | Date: | Thu, 11 Jan 2001 19:43:04 +0000 |
| Subject: | Re: help database creation.... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-34078@lists.php.net to get a copy of this message | ||
On Thu, 11 Jan 2001, 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>
>
Does that user have universal create rights?
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>