<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 -->
  <refentry id="function.mysql-create-db">
   <refnamediv>
    <refname>mysql_create_db</refname>
    <refpurpose>Create a MySQL database</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>bool</type><methodname>mysql_create_db</methodname>
      <methodparam><type>string</type><parameter>database_name</parameter></methodparam>
      <methodparam choice="opt"><type>resource</type><parameter>
        link_identifier
       </parameter></methodparam>
     </methodsynopsis>
    <para>
     <function>mysql_create_db</function> attempts to create a new
     database on the server associated with the specified link
     identifier.
    </para>
    <para>
     &return.success;
    </para>
    <example>
     <title>MySQL create database example</title>
     <programlisting role="php">
<![CDATA[
<?php
    $link = mysql_pconnect("localhost", "mysql_user", "mysql_password")
        or die("Could not connect: " . mysql_error());

    if (mysql_create_db("my_db")) {
        print ("Database created successfully\n");
    } else {
        printf ("Error creating database: %s\n", mysql_error());
    }
?>
]]>
     </programlisting>
    </example>
    <para>
     For downwards compatibility <function>mysql_createdb</function>
     can also be used. This is deprecated, however.
    </para>
    <note>
     <para>
      The function <function>mysql_create_db</function> is deprecated. It
      is preferable to use <function>mysql_query</function> to issue a
      <literal>SQL CREATE DATABASE</literal> Statement instead.
     </para>
    </note>
    <warning>
     <para>
      This function will not be available
      if the MySQL extension was built against a MySQL 4.x client library.
     </para> 
    </warning>
    <para>
     See also: <function>mysql_drop_db</function>,
               <function>mysql_query</function>.
    </para>
   </refsect1>
  </refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->