php-doc-en/reference/mssql/functions/mssql-select-db.xml
Sean Coates aac3851570 re-word incomplete statement
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@190513 c90b9560-bf6c-de11-be94-00142212c4b1
2005-07-11 17:21:33 +00:00

76 lines
2.4 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/mssql.xml, last change in rev 1.2 -->
<refentry id="function.mssql-select-db">
<refnamediv>
<refname>mssql_select_db</refname>
<refpurpose>Select MS SQL database</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>mssql_select_db</methodname>
<methodparam><type>string</type><parameter>database_name</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter></methodparam>
</methodsynopsis>
<para>
&return.success;
</para>
<para>
<function>mssql_select_db</function> sets the current active
database on the server that's associated with the specified link
identifier. If no link identifier is specified, the last opened
link is assumed. If no link is open, the function will try to
establish a link as if <function>mssql_connect</function> was
called, and use it.
</para>
<para>
Every subsequent call to <function>mssql_query</function> will be
made on the active database.
</para>
<para>
To escape the name of a database that contains spaces, hyphens ("-"), or
any other exceptional characters, the database name must be enclosed in
brackets, as is shown in the example, below. This technique must also be
applied when selecting a database name that is also a reserved word
(such as "primary").
</para>
<example>
<title><function>mssql_select_db</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$conn = mssql_connect('MYSQLSERVER', 'sa', 'password');
mssql_select_db('[my data-base]', $conn);
?>
]]>
</programlisting>
</example>
<para> See also:
<function>mssql_connect</function>,
<function>mssql_pconnect</function>, and
<function>mssql_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
-->