mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-29 23:38:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78496 c90b9560-bf6c-de11-be94-00142212c4b1
77 lines
2.2 KiB
XML
77 lines
2.2 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<!-- splitted from ./en/functions/ovrimos.xml, last change in rev 1.1 -->
|
|
<refentry id="function.ovrimos-prepare">
|
|
<refnamediv>
|
|
<refname>ovrimos_prepare</refname>
|
|
<refpurpose>Prepares an SQL statement</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>ovrimos_prepare</methodname>
|
|
<methodparam><type>int</type><parameter>connection_id</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>ovrimos_prepare</function> is used to prepare an SQL statement.
|
|
</para>
|
|
<para>
|
|
<function>ovrimos_prepare</function> prepares an SQL statement
|
|
and returns a result_id (or &false; on failure).
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Connect to Ovrimos SQL Server and prepare a statement</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$conn=ovrimos_connect ("db_host", "8001", "admin", "password");
|
|
if ($conn!=0) {
|
|
echo "Connection ok!";
|
|
$res=ovrimos_prepare ($conn, "select table_id, table_name
|
|
from sys.tables where table_id=1");
|
|
if ($res != 0) {
|
|
echo "Prepare ok!";
|
|
if (ovrimos_execute ($res)) {
|
|
echo "Execute ok!\n";
|
|
ovrimos_result_all ($res);
|
|
} else {
|
|
echo "Execute not ok!";
|
|
}
|
|
ovrimos_free_result ($res);
|
|
} else {
|
|
echo "Prepare not ok!\n";
|
|
}
|
|
ovrimos_close($conn);
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
This will connect to Ovrimos SQL Server, prepare a statement and
|
|
the execute it.
|
|
</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
|
|
-->
|