note 44277 added to function.mysql-create-db
| From: | ClaudioGarau at rn2 dot php dot net | Date: | Tue, 20 Jul 2004 11:50:56 +0000 |
| Subject: | note 44277 added to function.mysql-create-db | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-73681@lists.php.net to get a copy of this message | ||
<?php
/*creating a database called "example" with CREATE DATABASE*/
//connecting MySQL
$conn = mysql_connect("host", "user", "pass")
or die("Cannot connect to server.");
//query & confirm message
$query = "CREATE DATABASE example";
if (mysql_query($query, $connessione))
{
print ("Database creation confirmed.");
//using else if cannot create db
} else {
print ("Database creation failed.");
}
//closing connection
mysql_close($conn);
?>
----
Manual Page -- http://www.php.net/manual/en/function.mysql-create-db.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44277
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44277&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44277&report=yes
Search -- http://master.php.net/manage/user-notes.php