★ wanayoo — archive 1999 http://fr.php.net/manual/fr/function.mysql-create-db.phpNouvelle recherche | Portail wanayoo
PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
<mysql_connectmysql_data_seek>
view the version of this page
Last updated: Wed, 15 Jan 2003

mysql_create_db

(PHP 3, PHP 4 )

mysql_create_db -- Crée une base de données MySQL.

Description

int mysql_create_db ( string database_name [, resource link_identifier])

mysql_create_db() tente de créer une nouvelle base de données nommée database_name sur le serveur associé à l'identifiant link_identifier, ou sur la dernière connexion ouverte.

Exemple 1. Exemple de création de base MySQL

<?php
  $link = mysql_pconnect ("kron", "jutta", "geheim") {
    or die ("Connexion impossible");
  }
  if (mysql_create_db ("my_db")) {
    print ("Base de données créée\n");
  } else {
    echo "Erreur lors de la création de la base: ".mysql_error();
  }
?>

Pour des raisons de compatibilité ascendante, mysql_createdb() est toujours utilisable.

Voir aussi mysql_drop_db().

User Contributed Notes
mysql_create_db
add a note about notes
Edemilson Lima &lt;pulstar at mail dot com&gt;
09-Nov-2000 09:05

After create a new database with mysql_create_db(), you must select it with mysql_select_db(), to be able to access it.
blaat at blaat dot com
10-Jan-2003 06:09

You have to got the rights to creaty a database :P

I don't have the right :(

add a note about notes

<mysql_connectmysql_data_seek>
 Last updated: Wed, 15 Jan 2003
show source | credits | stats | mirror sites 
Copyright © 2001-2003 The PHP Group
All rights reserved.
This mirror generously provided by: nexen.net
Last updated: Tue Mar 4 04:11:34 2003 CET