Files
php-doc-ru/reference/mysql/functions/mysql-create-db.xml
2005-03-06 16:44:36 +00:00

87 lines
2.9 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.4 $ -->
<!-- EN-Revision: 1.7 Maintainer: lovchy Status: ready -->
<!-- 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>Создаёт базу данных MySQL</refpurpose>
</refnamediv>
<refsect1>
<title>Описание</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> пытается создать базу данных на
сервере, на который ссылается переданный указатель.
</para>
<para>
&return.success;
</para>
<para>
<example>
<title>Пример создания базы данных MySQL</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>
<para>
Для совместимости, как алиас, доступна устаревшая функция <function>mysql_createdb</function>
Однако, использовать её крайне не рекомандуется.
</para>
<note>
<para>
Функция <function>mysql_create_db</function> не рекомендуется к
использованию. Предпочтительнее использовать <function>mysql_query</function> с
SQL-запросов создания базы данных <literal>SQL CREATE DATABASE</literal>.
</para>
</note>
<warning>
<para>
Эта функция недоступна в библиотеке для MySQL версий 4.x.
</para>
</warning>
<para>
См. также
<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
-->