<?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[virgolette ed errore 1064: You have an error in your SQL syntax]]></title><description><![CDATA[<p dir="auto">Salve a tutti.<br />
Quando in un campo di testo inserisco anche le virgolette come per esempio "test", nel premere invio per inviare i dati nel database mi esce questo errore:</p>
<p dir="auto">1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'test"</p>
<p dir="auto">Come posso risolvere?<br />
La query che inserisce i dati nel database e':</p>
<pre><code class="language-php">$query="insert into ticket
(id_ticket, mittente, nome_ticket, codice_ticket, risposta, data_risposta)
values
(NULL,\"$mittente\",\"$nome_ticket\",\"$ticket\",\"$risposta\",NOW())";
echo"$query";
$risultato = @mysql_query($query) or die (mysql_errno() . ": " . mysql_error());
</code></pre>
<p dir="auto">Il campo in questione è $risposta<br />
Ho anche aggiunto stripslashes ma non serve a niente...</p>
<p dir="auto">Potete aiutarmi a risolvere?<br />
Grazie</p>
]]></description><link>https://dev.connect.gt/topic/228507/virgolette-ed-errore-1064-you-have-an-error-in-your-sql-syntax</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 01:09:51 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/228507.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 24 Feb 2017 18:11:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to virgolette ed errore 1064: You have an error in your SQL syntax on Mon, 27 Feb 2017 08:17:24 GMT]]></title><description><![CDATA[<p dir="auto">Ciao No_Stress<br />
l'errore è causato dal fatto che se stampi la variabile risposta otterrai "$test" interpretando come chiusura della strina le prime ".<br />
Prova a dare un'occhiata qua<br />
<a href="http://dk2.php.net/manual/en/function.mysql-real-escape-string.php" rel="nofollow ugc">http://dk2.php.net/manual/en/function.mysql-real-escape-string.php</a><br />
e nel frattempo prova anche a stampare la query nella sua interezza.</p>
]]></description><link>https://dev.connect.gt/post/1234317</link><guid isPermaLink="true">https://dev.connect.gt/post/1234317</guid><dc:creator><![CDATA[pietror]]></dc:creator><pubDate>Mon, 27 Feb 2017 08:17:24 GMT</pubDate></item></channel></rss>