<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[Gestione errori] mysql_errno();]]></title><description><![CDATA[<p dir="auto"><em><strong>PHP 4, 5</strong></em><br />
<em>Sintassi</em>: string <em><strong>mysql_errno</strong></em> ( [ resource <em><strong>$connessione</strong></em> ] )</p>
<p dir="auto"><em><strong>mysql_errno</strong></em> è una funzione che restituisce il valore numerico del messaggio di errore dell'ultima istruzione MySQL eseguita utilizzando, se specificato, l'identificativo di connessione passato come argomento. Qualora non venga specificato alcun identificativo di connessione la funzione utilizzerà l'ultima connessione aperta.<br />
Se non si sono presentati errori nell'istruzione questa restituirà il valore <em>0</em> (zero).</p>
<pre><code class="language-php">&lt;?
mysql_connect("localhost", "user", "password");
 
mysql_select_db ("pluto"); // ammettiamo che non esista il database pluto
echo mysql_errno();
 
// oppure potremmo scriverla in altro modo, ottenendo eguale risultato
mysql_select_db ("pluto") or die (mysql_errno());
?&gt;
</code></pre>
<p dir="auto">In entrambi i casi otterremo lo stesso codice d'errore:</p>
<pre><code>1049
</code></pre>
]]></description><link>https://dev.connect.gt/topic/64296/gestione-errori-mysql_errno</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 09:40:22 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/64296.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 22 Feb 2008 22:48:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Gestione errori] mysql_errno(); on Fri, 22 Feb 2008 23:07:15 GMT]]></title><description><![CDATA[<p dir="auto">Per completare le informazioni relative all'errore ed ottenere il testo relativo al messaggio restituito potremmo affiancare alla presente la funzione <a href="http://www.giorgiotave.it/forum/funzioni-di-php/70647-gestione-errori-mysql_error.html" rel="nofollow ugc">mysql_error();</a>.</p>
<pre><code class="language-php">&lt;?
mysql_connect("localhost", "user", "password");
 
mysql_select_db ("pluto"); // ammettiamo che non esista il database pluto
echo mysql_errno() . ": " . mysql_error();
?&gt;
</code></pre>
<p dir="auto">Otterremo in questo caso:</p>
<pre><code>1049: Unknown database 'pluto'
</code></pre>
]]></description><link>https://dev.connect.gt/post/686380</link><guid isPermaLink="true">https://dev.connect.gt/post/686380</guid><dc:creator><![CDATA[samyorn]]></dc:creator><pubDate>Fri, 22 Feb 2008 23:07:15 GMT</pubDate></item></channel></rss>