php-doc-en/reference/mysql/functions/mysql-create-db.xml
Stefan Walk f46de98880 CS, minor bugs
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@151948 c90b9560-bf6c-de11-be94-00142212c4b1
2004-02-20 17:36:42 +00:00

89 lines
2.4 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- 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>
<para>
<example>
<title>MySQL create database example</title>
<programlisting role="php">
<![CDATA[
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
if (mysql_create_db('my_db')) {
echo "Database created successfully\n";
} else {
echo 'Error creating database: ' . mysql_error() . "\n";
}
?>
]]>
</programlisting>
</example>
</para>
<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_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
-->