cvs: phpdoc-fr /reference/maxdb/functions maxdb-stmt-init.xml maxdb-stmt-num-rows.xml maxdb-stmt-param-count.xml maxdb-stmt-prepare.xml
maxdb-stmt-reset.xml maxdb-stmt-result-metadata.xml maxdb-stmt-send-long-data.xml maxdb-stmt-sqlstate.xml

From: Date: Fri, 21 Jan 2005 22:13:11 +0000
Subject: cvs: phpdoc-fr /reference/maxdb/functions maxdb-stmt-init.xml maxdb-stmt-num-rows.xml maxdb-stmt-param-count.xml maxdb-stmt-prepare.xml
maxdb-stmt-reset.xml maxdb-stmt-result-metadata.xml maxdb-stmt-send-long-data.xml maxdb-stmt-sqlstate.xml
Groups: php.doc.fr 
Request: Send a blank email to doc-fr+get-3840@lists.php.net to get a copy of this message
yannick Fri Jan 21 17:13:11 2005 EDT Added files: /phpdoc-fr/reference/maxdb/functions maxdb-stmt-init.xml maxdb-stmt-num-rows.xml maxdb-stmt-param-count.xml maxdb-stmt-prepare.xml maxdb-stmt-reset.xml maxdb-stmt-result-metadata.xml maxdb-stmt-send-long-data.xml maxdb-stmt-sqlstate.xml Log: initial translation

http://cvs.php.net/co.php/phpdoc-fr/reference/maxdb/functions/maxdb-stmt-init.xml?r=1.1&p=1 Index: phpdoc-fr/reference/maxdb/functions/maxdb-stmt-init.xml +++ phpdoc-fr/reference/maxdb/functions/maxdb-stmt-init.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.maxdb-stmt-init"> <refnamediv> <refname>maxdb_stmt_init</refname> <refpurpose> Initialise une requête et retourne une ressource à utiliser avec maxdb_stmt_prepare </refpurpose> </refnamediv> <refsect1> &reftitle.description; &title.procedural; <methodsynopsis> <type>resource</type><methodname>maxdb_stmt_init</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para> Alloue et initialise une ressource de requête utilisable pour la fonction <function>maxdb_stmt_prepare</function>. </para> <note> <para> Tous les appels de sous-séquence à n'importe quel fonction maxdb_stmt échoueront tant que la fonction <function>maxdb_stmt_prepare</function> ne sera pas appelée. </para> </note> </refsect1> <refsect1> &reftitle.returnvalues; <para> Retourne une ressource. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>maxdb_stmt_prepare</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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/maxdb/functions/maxdb-stmt-num-rows.xml?r=1.1&p=1 Index: phpdoc-fr/reference/maxdb/functions/maxdb-stmt-num-rows.xml +++ phpdoc-fr/reference/maxdb/functions/maxdb-stmt-num-rows.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.maxdb-stmt-num-rows"> <refnamediv> <refname>maxdb_stmt_num_rows</refname> <refpurpose>Retourne le nombre de lignes dans le jeu de résultats</refpurpose> </refnamediv> <refsect1> &reftitle.description; &title.procedural; <methodsynopsis> <type>mixed</type><methodname>maxdb_stmt_num_rows</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para> Retourne le nombre de lignes dans le jeu de résultats. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> Un entier représentant le nombre de lignes dans le jeu de résultats. </para> </refsect1> <refsect1> &reftitle.examples; <example> <title>Style procédural</title> <programlisting role="php"> <![CDATA[ <?php /* Ouvre une connexion */ $link = maxdb_connect("localhost", "MONA", "RED"); /* Vérification de la connexion */ if (maxdb_connect_errno()) { printf("Echec de la connexion : %s\n", maxdb_connect_error()); exit(); } $query = "SELECT zip, name FROM hotel.city ORDER BY name"; if ($stmt = maxdb_prepare($link, $query)) { /* Exécute une requête */ maxdb_stmt_execute($stmt); /* Stock le résultat */ maxdb_stmt_store_result($stmt); printf("Nombre de lignes : %d.\n", maxdb_stmt_num_rows($stmt)); /* Fermeture de la requête */ maxdb_stmt_close($stmt); } /* Fermeture de la connexion */ maxdb_close($link); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ Nombre de lignes : -1. ]]> </screen> </example> </refsect1> <refsect1> &reftitle.seealso; <para> <function>maxdb_stmt_affected_rows</function>, <function>maxdb_prepare</function> et <function>maxdb_stmt_store_result</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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/maxdb/functions/maxdb-stmt-param-count.xml?r=1.1&p=1 Index: phpdoc-fr/reference/maxdb/functions/maxdb-stmt-param-count.xml +++ phpdoc-fr/reference/maxdb/functions/maxdb-stmt-param-count.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.maxdb-stmt-param-count"> <refnamediv> <refname>maxdb_stmt_param_count</refname> <refpurpose>Retourne le nombre de marqueurs pour une requête donnée</refpurpose> </refnamediv> <refsect1> &reftitle.description; &title.procedural; <methodsynopsis> <type>int</type><methodname>maxdb_stmt_param_count</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para> <function>maxdb_stmt_param_count</function> retourne le nombre de marqueurs présent dans une requête préparée. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> Retourne un entier représentant le nombre de marqueurs. </para> </refsect1> <refsect1> &reftitle.examples; <example> <title>Style procédural</title> <programlisting role="php"> <![CDATA[ <?php $link = maxdb_connect("localhost", "MONA", "RED"); /* Vérification de la connexion */ if (maxdb_connect_errno()) { printf("Echec de la connexion : %s\n", maxdb_connect_error()); exit(); } if ($stmt = maxdb_prepare($link, "SELECT name FROM hotel.city WHERE name=? OR state=?")) { $marker = maxdb_stmt_param_count($stmt); printf("La requête contient %d marqueurs.\n", $marker); /* Fermeture de la requête */ maxdb_stmt_close($stmt); } /* Fermeture de la connexion */ maxdb_close($link); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ La requête contient 2 marqueurs. ]]> </screen> </example> </refsect1> <refsect1> &reftitle.seealso; <para> <function>maxdb_prepare</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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/maxdb/functions/maxdb-stmt-prepare.xml?r=1.1&p=1 Index: phpdoc-fr/reference/maxdb/functions/maxdb-stmt-prepare.xml +++ phpdoc-fr/reference/maxdb/functions/maxdb-stmt-prepare.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.maxdb-stmt-prepare"> <refnamediv> <refname>maxdb_stmt_prepare</refname> <refpurpose> Prépare une requête SQL pour exécution </refpurpose> </refnamediv> <refsect1> &reftitle.description; &title.procedural; <methodsynopsis> <type>bool</type><methodname>maxdb_stmt_prepare</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> <methodparam><type>string</type><parameter>query</parameter></methodparam> </methodsynopsis> <para> <function>maxdb_stmt_prepare</function> prépare une requête SQL pointée par une chaîne. La ressource de requête doit avoir été allouée par la fonction <function>maxdb_stmt_init</function>. La requête doit être constituée d'une simple requête SQL. </para> <note> <para> Vous ne devez pas ajouter de point-virgule final ou <literal>\g</literal> à la requête. </para> </note> <para> Le paramètre <parameter>query</parameter> peut inclure un ou plusieurs marqueurs de paramètres dans la requête SQL en y intégrant des points d'exclamations (<literal>?</literal>) à une position appropriée. </para> <note> <para> Les marqueurs sont autorisés uniquement à des positions précises dans les requêtes SQL. Par exemple, ils sont autorisés dans la liste VALUE() d'une requête INSERT (pour spécifier une valeur de colonne pour une ligne), ou dans une comparaison avec une colonne dans une clause WHERE pour spécifier une valeur de comparaison. </para> <para> Cependant, ils ne sont pas autorisés pour les identifiants (comme les noms de tables ou de colonnes), dans la liste SELECT qui nomme les colonnes à être retournées par les requêtes SELECT), ou pour spécifier les opérants d'un opérateur binaire comme le signe égal (<literal>=</literal>). La dernière restriction est nécessaire car il est impossible de déterminer le type du paramètre. En général, les paramètres sont légaux uniquement dans les requêtes <literal>Data Manipulation Languange (DML)</literal> et non dans les requêtes <literal>Data Defination Language (DDL)</literal>. </para> </note> <para> Les marqueurs doit être liés aux variables en utilisant les fonctions <function>maxdb_stmt_bind_param</function> et/ou <function>maxdb_stmt_bind_result</function> avant d'exécuter la requête ou de récupérer les lignes. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1> &reftitle.examples; <example> <title>Style procédural</title> <programlisting role="php"> <![CDATA[ <?php $link = maxdb_connect("localhost", "MONA", "RED"); /* Vérification de la connexion */ if (maxdb_connect_errno()) { printf("Echec de la connexion : %s\n", maxdb_connect_error()); exit(); } $city = "Portland"; /* Création d'une requête préparée */ $stmt = maxdb_stmt_init($link); if (maxdb_stmt_prepare($stmt, "SELECT state FROM hotel.city WHERE name=?")) { /* lie les paramètres aux marqueurs */ maxdb_stmt_bind_param($stmt, "s", $city); /* Exécute la requête */ maxdb_stmt_execute($stmt); /* Lie les variables de résultats */ maxdb_stmt_bind_result($stmt, $district); /* Récupère la valeur */ maxdb_stmt_fetch($stmt); printf("%s est dans %s\n", $city, $district); /* Fermeture de la requête */ maxdb_stmt_close($stmt); } /* Fermeture de la connexion */ maxdb_close($link); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ Portland est dans OR ]]> </screen> </example> </refsect1> <refsect1> &reftitle.seealso; <para> <function>maxdb_stmt_init</function>, <function>maxdb_stmt_execute</function>, <function>maxdb_stmt_fetch</function>, <function>maxdb_stmt_bind_param</function>, <function>maxdb_stmt_bind_result</function> et <function>maxdb_stmt_close</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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/maxdb/functions/maxdb-stmt-reset.xml?r=1.1&p=1 Index: phpdoc-fr/reference/maxdb/functions/maxdb-stmt-reset.xml +++ phpdoc-fr/reference/maxdb/functions/maxdb-stmt-reset.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.maxdb-stmt-reset"> <refnamediv> <refname>maxdb_stmt_reset</refname> <refpurpose>Réinitialise une requête préparée</refpurpose> </refnamediv> <refsect1> &reftitle.description; &title.procedural; <methodsynopsis> <type>bool</type><methodname>maxdb_stmt_reset</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> &warn.experimental.func; </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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/maxdb/functions/maxdb-stmt-result-metadata.xml?r=1.1&p=1 Index: phpdoc-fr/reference/maxdb/functions/maxdb-stmt-result-metadata.xml +++ phpdoc-fr/reference/maxdb/functions/maxdb-stmt-result-metadata.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.maxdb-stmt-result-metadata"> <refnamediv> <refname>maxdb_stmt_result_metadata</refname> <refpurpose>Retourneles méta-données du jeu de résultats pour une requête préparée</refpurpose> </refnamediv> <refsect1> &reftitle.description; &title.procedural; <methodsynopsis> <type>mixed</type><methodname>maxdb_stmt_result_metadata</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para> Si la requête passée à <function>maxdb_prepare</function> est une de celle pruisant un jeu de résultats, <function>maxdb_stmt_result_metadata</function> retourne la ressource de résultats qui peut être utilisée pour récupérer les méta-données comme, le nombre total de champs et les informations individuelles d'un champs. </para> <note> <para> Ce pointeur de résultats peut être passé comme argument à n'importe quelle fonction basé sur les champs qui traite les méta-données, comme : <itemizedlist> <listitem><para><function>maxdb_num_fields</function></para></listitem> <listitem><para><function>maxdb_fetch_field</function></para></listitem> <listitem><para><function>maxdb_fetch_field_direct</function></para></listitem> <listitem><para><function>maxdb_fetch_fields</function></para></listitem> <listitem><para><function>maxdb_field_count</function></para></listitem> <listitem><para><function>maxdb_field_seek</function></para></listitem> <listitem><para><function>maxdb_field_tell</function></para></listitem> <listitem><para><function>maxdb_free_result</function></para></listitem> </itemizedlist> </para> </note> <para> La structure du jeu de résultats doit être libérée lorsque vous en avez terminé avec, ce qui est obtenu en la passant à la fonction <function>maxdb_free_result</function>. </para> <note> <para> Le jeu de résultat retourné par <function>maxdb_stmt_result_metadata</function> contient uniquement des méta-données. Il ne contient aucune ligne de résultats. Les lignes sont obtenues en utilisant le gestionnaire de requête avec la fonction <function>maxdb_fetch</function>. </para> </note> </refsect1> <refsect1> &reftitle.returnvalues; <para> <function>maxdb_stmt_result_metadata</function> retourne une ressource de résultats ou &false; si une erreur survient. </para> </refsect1> <refsect1> &reftitle.examples; <para> <example> <title>Style procédural</title> <programlisting role='php'> <![CDATA[ <?php $link = maxdb_connect("localhost", "MONA", "RED"); maxdb_query($link, "CREATE TABLE temp.friends (id int, name varchar(20))"); maxdb_query($link, "INSERT INTO temp.friends VALUES (1,'Hartmut')"); maxdb_query($link, "INSERT INTO temp.friends VALUES (2, 'Ulf')"); $stmt = maxdb_prepare($link, "SELECT id, name FROM temp.friends"); maxdb_stmt_execute($stmt); /* Récupération du jeu de résultats pour les méta-données */ $result = maxdb_stmt_result_metadata($stmt); /* Récupère les informations d'un champs pour les méta-données du jeu de résultats */ $field = maxdb_fetch_field($result); printf("Nom du champs : %s\n", $field->name); /* Fermeture du jeu de résultats */ maxdb_free_result($result); /* Fermeture de la connexion */ maxdb_close($link); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ Nom du champs : ID ]]> </screen> </example> </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>maxdb_prepare</function>, <function>maxdb_free_result</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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/maxdb/functions/maxdb-stmt-send-long-data.xml?r=1.1&p=1 Index: phpdoc-fr/reference/maxdb/functions/maxdb-stmt-send-long-data.xml +++ phpdoc-fr/reference/maxdb/functions/maxdb-stmt-send-long-data.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.maxdb-stmt-send-long-data"> <refnamediv> <refname>maxdb_stmt_send_long_data</refname> <refpurpose>Envoi des données dans un block</refpurpose> </refnamediv> <refsect1> &reftitle.description; &title.procedural; <methodsynopsis> <type>bool</type><methodname>maxdb_stmt_send_long_data</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> <methodparam><type>int</type><parameter>param_nr</parameter></methodparam> <methodparam><type>string</type><parameter>data</parameter></methodparam> </methodsynopsis> <para> Permet d'envoyer des données au serveur sous forme de morceaux (ou gros morceaux). Cette fonction peut être appelée plusieurs fois pour envoyer les parties des caractères ou des valeurs de données binaires pour une colonne, qui peut être du type TEXT ou BLOB. </para> <para> <parameter>param_nr</parameter> indique quel paramètre à associer avec les données. Les paramètres sont nummérotés en commençant à 0. <parameter>data</parameter> est une chaîne contenant les données à envoyer. </para> <note> <para> Pour des raisons d'efficacité, cette fonction doit être utilisée après l'appel à la fonction <function>maxdb_execute</function>. Dans ce cas, les données ne sont pas stockées côté client. La fin de la séquence doit finir avec un appel à la fonction <function>maxdb_stmt_close_long_data</function>. </para> </note> </refsect1> <refsect1> &reftitle.returnvalues; <para>&return.success;</para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>maxdb_prepare</function> et <function>maxdb_stmt_bind_param</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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/maxdb/functions/maxdb-stmt-sqlstate.xml?r=1.1&p=1 Index: phpdoc-fr/reference/maxdb/functions/maxdb-stmt-sqlstate.xml +++ phpdoc-fr/reference/maxdb/functions/maxdb-stmt-sqlstate.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.maxdb-stmt-sqlstate"> <refnamediv> <refname>maxdb_stmt_sqlstate</refname> <refpurpose>Retourne une erreur SQLSTATE depuis la requête précédante</refpurpose> </refnamediv> <refsect1> &reftitle.description; <methodsynopsis> <type>string</type><methodname>maxdb_stmt_sqlstate</methodname> <methodparam><type>resource</type><parameter>stmt</parameter></methodparam> </methodsynopsis> <para> Retourne une chaîne contenant un code erreur SQLSTATE depuis la fonction de requête préparée la plus récente qu'elle ait réussie ou échouée. Le code erreur est composé de cinq caractères. <literal>'00000'</literal> signifie aucune erreur. La valeur est spécifiée par ANSI SQL et ODBC. </para> <note> <para> Notez que toutes les erreurs MaxDB ne sont pas encore liées à SQLSTATE. La valeur <literal>HY000</literal> (erreur général) est utilisée pour les erreurs non liées. </para> </note> </refsect1> <refsect1> &reftitle.returnvalues; <para> Retourne une chaîne contenant le code erreur SQLSTATE pour la dernière erreur. Le code erreur est composé de cinq caractères. <literal>'00000'</literal> signifie aucune erreur. </para> </refsect1> <refsect1> &reftitle.examples; <example> <title>Style procédural</title> <programlisting role="php"> <![CDATA[ <?php /* Ouvre une connexion */ $link = maxdb_connect("localhost", "MONA", "RED"); /* Vérification de la connexion */ if (maxdb_connect_errno()) { printf("Echec de la connexion : %s\n", maxdb_connect_error()); exit(); } maxdb_query($link, "CREATE TABLE temp.mycity LIKE hotel.city"); maxdb_query($link, "INSERT INTO temp.mycity SELECT * FROM hotel.city"); $query = "SELECT name, zip FROM temp.mycity ORDER BY name"; if ($stmt = maxdb_prepare($link, $query)) { /* Efface la table */ maxdb_query($link, "DROP TABLE temp.mycity"); /* Exécute une requête */ maxdb_stmt_execute($stmt); printf("Erreur : %s.\n", maxdb_stmt_sqlstate($stmt)); /* Ferme la requête */ maxdb_stmt_close($stmt); } /* Fermeture de la connexion */ maxdb_close($link); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ Warning: maxdb_stmt_execute(): -4004 POS(23) Unknown table name:MYCITY [42000] <...> Erreur : 42000. ]]> </screen> </example> </refsect1> <refsect1> &reftitle.seealso; <para> <function>maxdb_stmt_errno</function> et <function>maxdb_stmt_error</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 -->
« previous php.doc.fr (#3840) next »