cvs: phpdoc-fr /reference/mssql/functions mssql-bind.xml mssql-connect.xml mssql-free-statement.xml mssql-guid-string.xml

From: Date: Mon, 02 Feb 2009 08:22:50 +0000
Subject: cvs: phpdoc-fr /reference/mssql/functions mssql-bind.xml mssql-connect.xml mssql-free-statement.xml mssql-guid-string.xml
Groups: php.doc.fr 
Request: Send a blank email to doc-fr+get-6551@lists.php.net to get a copy of this message
dams Mon Feb 2 08:22:50 2009 UTC Modified files: /phpdoc-fr/reference/mssql/functions mssql-bind.xml mssql-connect.xml mssql-free-statement.xml mssql-guid-string.xml Log: synch with en

http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/mssql/functions/mssql-bind.xml?r1=1.16&r2=1.17&diff_format=u Index: phpdoc-fr/reference/mssql/functions/mssql-bind.xml diff -u phpdoc-fr/reference/mssql/functions/mssql-bind.xml:1.16 phpdoc-fr/reference/mssql/functions/mssql-bind.xml:1.17 --- phpdoc-fr/reference/mssql/functions/mssql-bind.xml:1.16 Sat Jun 21 20:51:38 2008 +++ phpdoc-fr/reference/mssql/functions/mssql-bind.xml Mon Feb 2 08:22:50 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.16 $ --> -<!-- EN-Revision: 1.13 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.17 $ --> +<!-- EN-Revision: 1.17 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id='function.mssql-bind' xmlns="http://docbook.org/ns/docbook"> @@ -17,9 +17,9 @@ <methodparam><type>string</type><parameter>param_name</parameter></methodparam> <methodparam><type>mixed</type><parameter role="reference">var</parameter></methodparam> <methodparam><type>int</type><parameter>type</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>is_output</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>is_null</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>maxlen</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>is_output</parameter><initializer>false</initializer></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>is_null</parameter><initializer>false</initializer></methodparam> + <methodparam choice="opt"><type>int</type><parameter>maxlen</parameter><initializer>-1</initializer></methodparam> </methodsynopsis> <para> Ajoute un paramètre à une procédure stockée MSSQL (locale ou distante). @@ -58,8 +58,8 @@ <term><parameter>var</parameter></term> <listitem> <para> - La variable PHP que vous voulez lier au paramètre MSSQL. Vous pouvez - la passer par valeur, ou par référence pour récupérer les valeurs + La variable PHP que vous voulez lier au paramètre MSSQL. Il faut + la passer par référence pour récupérer les valeurs OUTPUT et RETVAL après l'exécution de la procédure. </para> </listitem> @@ -100,8 +100,8 @@ <term><parameter>maxlen</parameter></term> <listitem> <para> - Utilisé avec les valeurs de type char et varchar. Vous devez indiquer - la longueur des données, donc, si ce paramètre vaut varchar(50), le type + Utilisé avec les valeurs de type CHAR et VARCHAR. Vous devez indiquer + la longueur des données, donc, si ce paramètre vaut VARCHAR(50), le type doit être <constant>SQLVARCHAR</constant> et sa valeur, <literal>50</literal>. </para> </listitem> @@ -125,18 +125,23 @@ <programlisting role="php"> <![CDATA[ <?php +// Connexion à MSSQL +mssql_connect('KALLESPC\SQLEXPRESS', 'sa', 'phpfi'); +mssql_select_db('php'); + +// Crée une nouvelle procédure stockée +$stmt = mssql_init('NewUserRecord'); + +// Lie les noms de champs +mssql_bind($stmt, '@username', 'Kalle', SQLVARCHAR, false, false, 60); +mssql_bind($stmt, '@name', 'Kalle', SQLVARCHAR, false, false, 60); +mssql_bind($stmt, '@age', 19, SQLINT1, false, false, 3); -$cn = mssql_connect($DBSERVER, $DBUSER, $DBPASS); -mssql_select_db($DB, $cn); - -$sp = mssql_init("WDumpAdd"); // stock le nom de la procédure - -mssql_bind($sp, "@productname", stripslashes($newproduct), SQLVARCHAR, false, false, 150); -mssql_bind($sp, "@quantity", stripslashes($newquantity), SQLVARCHAR, false, false, 50); - -mssql_execute($sp); -mssql_close($cn); +// Exécute +mssql_execute($stmt); +// Libère les ressources +mssql_free_statement($stmt); ?> ]]> </programlisting> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/mssql/functions/mssql-connect.xml?r1=1.16&r2=1.17&diff_format=u Index: phpdoc-fr/reference/mssql/functions/mssql-connect.xml diff -u phpdoc-fr/reference/mssql/functions/mssql-connect.xml:1.16 phpdoc-fr/reference/mssql/functions/mssql-connect.xml:1.17 --- phpdoc-fr/reference/mssql/functions/mssql-connect.xml:1.16 Sun Apr 20 13:59:50 2008 +++ phpdoc-fr/reference/mssql/functions/mssql-connect.xml Mon Feb 2 08:22:50 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.16 $ --> -<!-- EN-Revision: 1.9 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.17 $ --> +<!-- EN-Revision: 1.12 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.mssql-connect" xmlns="http://docbook.org/ns/docbook"> @@ -20,8 +20,7 @@ </methodsynopsis> <para> <function>mssql_connect</function> établit une connexion - à un serveur MS SQL. Le nom du serveur <parameter>servername</parameter> - doit être valide, comme défini dans les fichiers d'interface. + à un serveur MS SQL. </para> <para> Le lien avec le serveur sera fermé dès la fin du script, @@ -108,6 +107,31 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>mssql_connect</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Le serveur est au format : <hôte>\<nom d'instance> ou +// <serveur>,<port> quand on utilise un port différent de celui par défaut +$server = 'KALLESPC\SQLEXPRESS'; + +$link = mssql_connect($server, 'sa', 'phpfi'); + +if(!$link) +{ + die('Erreur de connexion à MSSQL'); +} +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/mssql/functions/mssql-free-statement.xml?r1=1.10&r2=1.11&diff_format=u Index: phpdoc-fr/reference/mssql/functions/mssql-free-statement.xml diff -u phpdoc-fr/reference/mssql/functions/mssql-free-statement.xml:1.10 phpdoc-fr/reference/mssql/functions/mssql-free-statement.xml:1.11 --- phpdoc-fr/reference/mssql/functions/mssql-free-statement.xml:1.10 Mon Jul 23 19:06:59 2007 +++ phpdoc-fr/reference/mssql/functions/mssql-free-statement.xml Mon Feb 2 08:22:50 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> -<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.11 $ --> +<!-- EN-Revision: 1.8 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id="function.mssql-free-statement" xmlns="http://docbook.org/ns/docbook"> @@ -49,6 +49,29 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>mssql_free_statement</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Crée une nouvelle commande +$stmt = mssql_init('test'); + +// Exécute la commande ici + +// Une fois terminé, nous pouvons libérer les ressources +// avec mssql_free_statement, comme ceci : +mssql_free_statement($stmt); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> @@ -56,6 +79,7 @@ <member><function>mssql_bind</function></member> <member><function>mssql_execute</function></member> <member><function>mssql_init</function></member> + <member><function>mssql_free_result</function></member> </simplelist> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc-fr/reference/mssql/functions/mssql-guid-string.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc-fr/reference/mssql/functions/mssql-guid-string.xml diff -u phpdoc-fr/reference/mssql/functions/mssql-guid-string.xml:1.9 phpdoc-fr/reference/mssql/functions/mssql-guid-string.xml:1.10 --- phpdoc-fr/reference/mssql/functions/mssql-guid-string.xml:1.9 Mon Jul 23 19:06:59 2007 +++ phpdoc-fr/reference/mssql/functions/mssql-guid-string.xml Mon Feb 2 08:22:50 2009 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> -<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready --> +<!-- $Revision: 1.10 $ --> +<!-- EN-Revision: 1.10 Maintainer: yannick Status: ready --> <!-- Reviewed: yes --> <refentry xml:id='function.mssql-guid-string' xmlns="http://docbook.org/ns/docbook"> @@ -14,13 +14,73 @@ <methodsynopsis> <type>string</type><methodname>mssql_guid_string</methodname> <methodparam><type>string</type><parameter>binary</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>short_format</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>short_format</parameter><initializer>false</initializer></methodparam> </methodsynopsis> - &warn.undocumented.func; + <para> + Convertit un GUID binaire de 16 octets en une chaîne de caractères. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>binary</parameter></term> + <listitem> + <para> + Un GUID binaire, de 16 octets. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>short_format</parameter></term> + <listitem> + <para> + &true; s'il faut utiliser le format court : par défaut, &false; + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Retourne la chaîne convertie en cas de succès. + </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Exemple avec <function>mssql_guid_string</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$binary = '19555081977808608437941339997619274330352755554827939936'; + +var_dump(mssql_guid_string($binary)); +var_dump(mssql_guid_string($binary, true)); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +string(36) "35353931-3035-3138-3937-373830383630" +string(32) "31393535353038313937373830383630" +]]> + </screen> + </example> + </para> + </refsect1> + +</refentry> + </refentry> <!-- Keep this comment at the end of the file
« previous php.doc.fr (#6551) next »