mysql_create_db

(PHP3 , PHP4 )

mysql_create_db -- Create a MySQL database

Description

int mysql_create_db (string database name [, int link_identifier])

mysql_create_db() attempts to create a new database on the server associated with the specified link identifier.

Példa 1. MySQL create database example

  1 
  2 <?php
  3     $link = mysql_pconnect ("kron", "jutta", "geheim")
  4         or die ("Could not connect");
  5     if (mysql_create_db ("my_db")) {
  6         print ("Database created successfully\n");
  7     } else {
  8         printf ("Error creating database: %s\n", mysql_error ());
  9     }
 10 ?>
 11      

For downwards compatibility mysql_createdb() can also be used.

See also: mysql_drop_db().