cvs: phpdoc-fr /reference/mysql/functions mysql-create-db.xml mysql-data-seek.xml mysql-list-fields.xml mysql-list-tables.xml mysql-result.xml

From: Date: Tue, 02 Mar 2004 16:13:20 +0000
Subject: cvs: phpdoc-fr /reference/mysql/functions mysql-create-db.xml mysql-data-seek.xml mysql-list-fields.xml mysql-list-tables.xml mysql-result.xml
Groups: php.doc.fr 
Request: Send a blank email to doc-fr+get-1938@lists.php.net to get a copy of this message
didou Tue Mar 2 11:13:20 2004 EDT Modified files: /phpdoc-fr/reference/mysql/functions mysql-create-db.xml mysql-data-seek.xml mysql-list-fields.xml mysql-list-tables.xml mysql-result.xml Log: parse error http://cvs.php.net/diff.php/phpdoc-fr/reference/mysql/functions/mysql-create-db.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc-fr/reference/mysql/functions/mysql-create-db.xml diff -u phpdoc-fr/reference/mysql/functions/mysql-create-db.xml:1.7 phpdoc-fr/reference/mysql/functions/mysql-create-db.xml:1.8 --- phpdoc-fr/reference/mysql/functions/mysql-create-db.xml:1.7 Tue Feb 24 13:12:07 2004 +++ phpdoc-fr/reference/mysql/functions/mysql-create-db.xml Tue Mar 2 11:13:20 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> <!-- splitted from ./fr/functions/mysql.xml, last change in rev 1.19 --> @@ -33,14 +33,13 @@ <programlisting role="php"> <![CDATA[ <?php - $link = mysql_pconnect ("kron", "jutta", "geheim") { - or die ("Connexion impossible"); - } - if (mysql_create_db ("my_db")) { - print ("Base de données créée\n"); - } else { - echo "Erreur lors de la création de la base: ".mysql_error(); - } +$link = mysql_pconnect("kron", "jutta", "geheim") or die ("Connexion impossible"); + +if (mysql_create_db("my_db")) { + echo "Base de données créée\n"; +} else { + echo "Erreur lors de la création de la base: " . mysql_error(); +} ?> ]]> </programlisting> http://cvs.php.net/diff.php/phpdoc-fr/reference/mysql/functions/mysql-data-seek.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/mysql/functions/mysql-data-seek.xml diff -u phpdoc-fr/reference/mysql/functions/mysql-data-seek.xml:1.6 phpdoc-fr/reference/mysql/functions/mysql-data-seek.xml:1.7 --- phpdoc-fr/reference/mysql/functions/mysql-data-seek.xml:1.6 Tue Feb 24 13:12:07 2004 +++ phpdoc-fr/reference/mysql/functions/mysql-data-seek.xml Tue Mar 2 11:13:20 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> <!-- splitted from ./fr/functions/mysql.xml, last change in rev 1.19 --> @@ -44,27 +44,23 @@ <programlisting role="php"> <![CDATA[ <?php - $link = mysql_pconnect ("kron", "jutta", "geheim") { - or die ("Connexion impossible"); - } - mysql_select_db ("samp_db") { - or die ("Sélection de base impossible"); - } - $query = "SELECT last_name, first_name FROM friends"; - $result = mysql_query ($query) { - or die ("Requête impossible"); - } +$link = mysql_pconnect("kron", "jutta", "geheim") or die ("Connexion impossible"); +mysql_select_db("samp_db") or die ("Sélection de base impossible"); + +$query = "SELECT last_name, first_name FROM friends"; +$result = mysql_query($query) or die ("Requête impossible"); + // récupère les lignes dans l'ordre inverse - for ($i = mysql_num_rows ($result) - 1; $i >=0; $i--) { - if (!mysql_data_seek ($result, $i)) { - echo "Impossible d'atteindre la ligne $i\n"; - continue; - } - if(!($row = mysql_fetch_object ($result))) - continue; - echo "{$row->last_name} {$row->last_name$row->first_name}<BR>\n"; +for ($i = mysql_num_rows($result) - 1; $i >=0; $i--) { + if (!mysql_data_seek($result, $i)) { + echo "Impossible d'atteindre la ligne $i\n"; + continue; } - mysql_free_result ($result); + if(!($row = mysql_fetch_object($result))) + continue; + echo "{$row->last_name} {$row->last_name$row->first_name}<br />\n"; +} +mysql_free_result($result); ?> ]]> </programlisting> http://cvs.php.net/diff.php/phpdoc-fr/reference/mysql/functions/mysql-list-fields.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc-fr/reference/mysql/functions/mysql-list-fields.xml diff -u phpdoc-fr/reference/mysql/functions/mysql-list-fields.xml:1.7 phpdoc-fr/reference/mysql/functions/mysql-list-fields.xml:1.8 --- phpdoc-fr/reference/mysql/functions/mysql-list-fields.xml:1.7 Tue Feb 24 13:12:07 2004 +++ phpdoc-fr/reference/mysql/functions/mysql-list-fields.xml Tue Mar 2 11:13:20 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> <!-- splitted from ./fr/functions/mysql.xml, last change in rev 1.19 --> @@ -52,6 +52,7 @@ for ($i = 0; $i < $columns; $i++) { echo mysql_field_name($fields, $i) . "\n"; } +?> ]]> </programlisting> <para> http://cvs.php.net/diff.php/phpdoc-fr/reference/mysql/functions/mysql-list-tables.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-fr/reference/mysql/functions/mysql-list-tables.xml diff -u phpdoc-fr/reference/mysql/functions/mysql-list-tables.xml:1.6 phpdoc-fr/reference/mysql/functions/mysql-list-tables.xml:1.7 --- phpdoc-fr/reference/mysql/functions/mysql-list-tables.xml:1.6 Tue Feb 24 13:12:07 2004 +++ phpdoc-fr/reference/mysql/functions/mysql-list-tables.xml Tue Mar 2 11:13:20 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> <!-- splitted from ./fr/functions/mysql.xml, last change in rev 1.19 --> @@ -41,26 +41,26 @@ <programlisting role="php"> <![CDATA[ <?php - $dbname = 'test'; +$dbname = 'test'; - if (!mysql_connect('serveur_mysql', 'utilisateur_mysql', 'mot_de_passe_mysql') { - print 'Impossible de se connecter à MySQL'; - exit; - } - - $result = mysql_list_tables($dbname); - - if (!$result) { - print "Erreur : impossible de lister les bases de données\n"; - print 'Erreur MySQL : ' . mysql_error(); - exit; - } - - while ($row = mysql_fetch_row($result)) { - print "Table : $row[0]\n"; - } +if (!mysql_connect('serveur_mysql', 'utilisateur_mysql', 'mot_de_passe_mysql')) { + echo 'Impossible de se connecter à MySQL'; + exit; +} - mysql_free_result($result); +$result = mysql_list_tables($dbname); + +if (!$result) { + echo "Erreur : impossible de lister les bases de données\n"; + echo 'Erreur MySQL : ' . mysql_error(); + exit; +} + +while ($row = mysql_fetch_row($result)) { + echo "Table : $row[0]\n"; +} + +mysql_free_result($result); ?> ]]> </programlisting> http://cvs.php.net/diff.php/phpdoc-fr/reference/mysql/functions/mysql-result.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc-fr/reference/mysql/functions/mysql-result.xml diff -u phpdoc-fr/reference/mysql/functions/mysql-result.xml:1.7 phpdoc-fr/reference/mysql/functions/mysql-result.xml:1.8 --- phpdoc-fr/reference/mysql/functions/mysql-result.xml:1.7 Tue Feb 24 13:12:07 2004 +++ phpdoc-fr/reference/mysql/functions/mysql-result.xml Tue Mar 2 11:13:20 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <!-- EN-Revision: 1.1 Maintainer: nobody Status: partial --> <!-- splitted from ./fr/functions/mysql.xml, last change in rev 1.19 --> @@ -48,7 +48,7 @@ or die("Impossible de se connecter : " . mysql_error()); $result = mysql_query("SELECT name FROM work.employee") - or die("Impossible d'exécuter la requête : . mysql_error()); + or die("Impossible d'exécuter la requête : " . mysql_error()); echo mysql_result($result,2); // Affiche le nom du troisième employé

« previous php.doc.fr (#1938) next »