<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.16 $ -->
<refentry id="function.mysql-drop-db">
 <refnamediv>
  <refname>mysql_drop_db</refname>
  <refpurpose>Drop (delete) a MySQL database</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>bool</type><methodname>mysql_drop_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_drop_db</function> attempts to drop (remove) an
   entire database from the server associated with the specified
   link identifier. This function is deprecated, it is preferable to use 
   <function>mysql_query</function> to issue a sql 
   <literal>DROP DATABASE</literal> statement instead.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>database_name</parameter></term>
     <listitem>
      <para>
       The name of the database that will be deleted.
      </para>
     </listitem>
    </varlistentry>
    &mysql.linkid.description;
   </variablelist>
  </para>
 </refsect1>
 
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   &return.success;
  </para>
 </refsect1>
  
 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title><function>mysql_drop_db</function> alternative example</title>
    <programlisting role="php">
<![CDATA[
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}

$sql = 'DROP DATABASE my_db';
if (mysql_query($sql, $link)) {
    echo "Database my_db was successfully dropped\n";
} else {
    echo 'Error dropping database: ' . mysql_error() . "\n";
}
?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>

 <refsect1 role="notes">
  &reftitle.notes;
  <warning>
   <para>
    This function will not be available if the MySQL extension was built 
    against a MySQL 4.x client library.
   </para>
  </warning>
  <note>
   <para>
    &info.deprecated.alias;
    <function>mysql_dropdb</function>
   </para>
  </note>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>mysql_query</function></member>
   </simplelist>
  </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
-->