mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-25 17:32:07 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@328788 c90b9560-bf6c-de11-be94-00142212c4b1
124 lines
3.4 KiB
XML
124 lines
3.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 65e697ff671608989432a6e6bf8ae8128b2be2c7 Maintainer: itanea Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="function.mysql-errno" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>mysql_errno</refname>
|
|
<refpurpose>Retourne le numéro d'erreur de la dernière commande MySQL</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsynopsisdiv>
|
|
<warning>
|
|
&mysql.alternative.note;
|
|
<simplelist role="alternatives">
|
|
<member><function>mysqli_errno</function></member>
|
|
<member><methodname>PDO::errorCode</methodname></member>
|
|
</simplelist>
|
|
</warning>
|
|
</refsynopsisdiv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>mysql_errno</methodname>
|
|
<methodparam choice="opt"><type>resource</type><parameter>link_identifier</parameter><initializer>NULL</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Retourne le numéro d'erreur de la dernière commande MySQL.
|
|
</para>
|
|
<para>
|
|
Les erreurs qui
|
|
sont remontées depuis le serveur MySQL ne sont plus des alertes.
|
|
À la place, il faut utiliser <function>mysql_errno</function> pour
|
|
obtenir le numéro d'erreur. Notez que cette fonction retourne uniquement
|
|
le code erreur depuis la dernière fonction MySQL exécutée
|
|
(n'incluant pas les fonctions <function>mysql_error</function> et
|
|
<function>mysql_errno</function>), donc, si vous voulez l'utiliser,
|
|
assurez-vous de récupérer la valeur avant d'appeler une autre fonction
|
|
MySQL.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
&mysql.linkid.description;
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne le numéro de l'erreur depuis la dernière fonction MySQL, ou
|
|
&zero; (zéro) si aucune erreur ne survient.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>mysql_errno</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$link = mysql_connect("localhost", "mysql_user", "mysql_password");
|
|
|
|
if (!mysql_select_db("nonexistentdb", $link)) {
|
|
echo mysql_errno($link) . ": " . mysql_error($link). "\n";
|
|
}
|
|
|
|
mysql_select_db("kossu", $link);
|
|
if (!mysql_query("SELECT * FROM nonexistenttable", $link)) {
|
|
echo mysql_errno($link) . ": " . mysql_error($link) . "\n";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
1049: Unknown database 'nonexistentdb'
|
|
1146: Table 'kossu.nonexistenttable' doesn't exist
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>mysql_error</function></member>
|
|
<member><link xlink:href="&url.mysql.docs.error;">les codes erreurs MySQL</link></member>
|
|
</simplelist>
|
|
</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:"~/.phpdoc/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
|
|
-->
|