php-doc-en/reference/maxdb/reference.xml

118 lines
3.1 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<reference id="ref.maxdb">
<title>MaxDB PHP Extension</title>
<titleabbrev>MaxDB</titleabbrev>
<partintro>
<section id="maxdb.intro">
&reftitle.intro;
<para>
The MaxDB PHP extension allows you to access the functionality provided by
MaxDB 7.5.0 and above. More information about the MaxDB Database server
can be found at <ulink url="&url.maxdb;">&url.maxdb;</ulink>.
</para>
<para>
Documentation for MaxDB can be found at
<ulink url="&url.maxdb.doc;">&url.maxdb.doc;</ulink>.
</para>
</section>
<section id="maxdb.requirements">
&reftitle.required;
<para>
In order to have these functions available, you must compile PHP with
MaxDB support. Additionally, you must have the MaxDB SQLDBC runtime library
available to access the MaxDB server.
</para>
<para>
Documentation for MaxDB SQLDBC can be found at
<ulink url="&url.maxdb.doc;">&url.maxdb.doc;</ulink>.
</para>
<para>
Download the MaxDB SQLDBC package from
<ulink url="&url.maxdb.sdbc;">&url.maxdb.sdbc;</ulink>.
</para>
</section>
&reference.maxdb.configure;
&reference.maxdb.ini;
&reference.maxdb.constants;
<section id="maxdb.examples">
&reftitle.examples;
<para>
All examples in the MaxDB PHP documentation use the HOTELDB demo database from MaxDB. More about this
database can be found at <ulink url="&url.maxdb.sampledb;">&url.maxdb.sampledb;</ulink>.
</para>
<para>
This simple example shows how to connect, execute a query, print
resulting rows and disconnect from a MaxDB database.
<example>
<title>MaxDB extension overview example</title>
<programlisting role="php">
<![CDATA[
<?php
/* Connecting, selecting database */
$link = maxdb_connect("maxdb_host", "maxdb_user", "maxdb_password")
or die("Could not connect : " . maxdb_connect_error());
echo "Connected successfully";
maxdb_select_db("my_database") or die("Could not select database");
/* Performing SQL query */
$query = "SELECT * FROM my_table";
$result = maxdb_query($link, $query) or die("Query failed : " . maxdb_error());
/* Printing results in HTML */
echo "<table>\n";
while ($line = maxdb_fetch_array($result, MAXDB_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table>\n";
/* Free resultset */
maxdb_free_result($result);
/* Closing connection */
maxdb_close($link);
?>
]]>
</programlisting>
</example>
</para>
</section>
</partintro>
&reference.maxdb.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
-->