mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-21 03:18:55 +00:00
72 lines
2 KiB
XML
72 lines
2 KiB
XML
![]() |
<?xml version="1.0" encoding="iso-8859-1"?>
|
||
|
<!-- 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 exit("Could not connect");
|
||
|
|
||
|
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>
|
||
|
<para>
|
||
|
See also: <function>mysql_drop_db</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
|
||
|
-->
|