php-doc-en/reference/msql/reference.xml
Nuno Lopes b069a314a4 add tagging
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@195136 c90b9560-bf6c-de11-be94-00142212c4b1
2005-09-04 19:39:32 +00:00

105 lines
2.4 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.13 $ -->
<!-- Purpose: database.vendors -->
<!-- Membership: bundled, external -->
<reference id="ref.msql">
<title>mSQL Functions</title>
<titleabbrev>mSQL</titleabbrev>
<partintro>
<section id="msql.intro">
&reftitle.intro;
<para>
These functions allow you to access mSQL database servers. More
information about mSQL can be found at
<ulink url="&url.msql;">&url.msql;</ulink>.
</para>
</section>
&reference.msql.configure;
&reference.msql.ini;
<section id="msql.resources">
&reftitle.resources;
<para>
There are two resource types used in the mSQL module. The first one
is the link identifier for a database connection, the second a resource
which holds the result of a query.
</para>
</section>
&reference.msql.constants;
<section id="msql.examples">
&reftitle.examples;
<para>
This simple example shows how to connect, execute a query, print
resulting rows and disconnect from a mSQL database.
<example>
<title>mSQL usage example</title>
<programlisting role="php">
<![CDATA[
<?php
/* Connecting, selecting database */
$link = msql_connect('localhost', 'username', 'password')
or die('Could not connect : ' . msql_error($link));
msql_select_db('database', $link)
or die('Could not select database');
/* Issue SQL query */
$query = 'SELECT * FROM my_table';
$result = msql_query($query, $link) or die('Query failed : ' . msql_error($link));
/* Printing results in HTML */
echo "<table>\n";
while ($row = msql_fetch_array($result, MSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($row as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table>\n";
/* Free result set */
msql_free_result($result);
/* Close connection */
msql_close($link);
?>
]]>
</programlisting>
</example>
</para>
</section>
</partintro>
&reference.msql.functions;
</reference>
<!-- 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
-->