<?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_error();]]></title><description><![CDATA[<p dir="auto"><em><strong>PHP 4, 5</strong></em><br />
<em>Sintassi</em>: string <em><strong>mysql_error</strong></em> ( [ resource <em><strong>$connessione</strong></em> ] )</p>
<p dir="auto"><em><strong>mysql_error</strong></em> è una funzione che restituisce il testo 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 funzione restituirà una stringa vuota ''.</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_error();
 
// oppure potremmo scriverla in altro modo, ottenendo eguale risultato
mysql_select_db ("pluto") or die (mysql_error());
?&gt;
</code></pre>
<p dir="auto">In entrambi i casi otterremo un messaggio di errore:</p>
<pre><code>Unknown database 'pluto'
</code></pre>
]]></description><link>https://dev.connect.gt/topic/64301/gestione-errori-mysql_error</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 09:40:23 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/64301.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 22 Feb 2008 22:34:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Gestione errori] mysql_error(); on Fri, 22 Feb 2008 23:06:05 GMT]]></title><description><![CDATA[<p dir="auto">Se volessimo completare le informazioni restituite con il codice errore, utilizzeremo anche la funzione <a href="http://www.giorgiotave.it/forum/funzioni-di-php/70648-gestione-errori-mysql_errno.html" rel="nofollow ugc">mysql_errno();</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/686393</link><guid isPermaLink="true">https://dev.connect.gt/post/686393</guid><dc:creator><![CDATA[samyorn]]></dc:creator><pubDate>Fri, 22 Feb 2008 23:06:05 GMT</pubDate></item></channel></rss>