<?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[errore di sintassi]]></title><description><![CDATA[<p dir="auto">raga qualcuno puo' aiutarmi? ci sto diventando scemo, ho aggiunto solo qualcosa e mi da<br />
Errore di sintassi nella query SQL vicino a 'add ,liv ,data_ass ,cod_qual ,altri_dati_dip1 ,altri_dati_dip2 ,altr' linea 1.</p>
<p dir="auto">Nella query ho messo $anag = mysql_query($q) or die (mysql_error());<br />
ma che vuol dire linea 1. Non riesco a trovare l'errore... eppure ho solo aggiunto dei campi....</p>
<p dir="auto">eppure andava prima....</p>
<p dir="auto">questa era la vecchia query:</p>
<pre><code class="language-php">$q  = "insert into anag_dip (";
$q .= "    id_utente";
$q .= "   ,id_azienda";
$q .= "   ,cognome";
$q .= "   ,nome";
$q .= "   ,data_nascita";
$q .= "   ,citta_nascita";
$q .= "   ,codice_fiscale";
$q .= "   ,citta_residenza";
$q .= "   ,indirizzo";
$q .= "   ,cap";
$q .= "   ,non_so";
$q .= "   ,non_so2";
$q .= "   ,non_so3";

$q .= "   ,altri_dati_dip1";
$q .= "   ,altri_dati_dip2";
$q .= "   ,altri_dati_dip3";
$q .= "   ,altri_dati_dip4";
$q .= "   ,altri_dati_dip5";
$q .= "   ,altri_dati_dip6";
$q .= "   ,altri_dati_dip7";
$q .= "   ,altri_dati_dip8";
$q .= "   ,altri_dati_dip9";
$q .= "   ,altri_dati_dip10";
$q .= "   ,altri_dati_dip11";
$q .= "   ,altri_dati_dip12";
$q .= "   ,altri_dati_dip13";

$q .= " ) values (";
$q .= "    (SELECT user_id FROM tbl_users WHERE user_name = '" . $_SESSION['logged'][0] . "')";
$q .= "   ,'" . $_POST['dittas'] . "'";
$q .= "   ,'" . addslashes(trim($_POST['cognome'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['nome'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['data_nascita'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['citta_nascita'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['codice_fiscale'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['citta_residenza'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['indirizzo'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['cap'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['non_so'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['non_so2'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['non_so3'])) . "'";

$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip1'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip2'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip3'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip4'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip5'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip6'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip7'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip8'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip9'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip10'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip11'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip12'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip13'])) . "'";

$q .= " )";

$anag = mysql_query($q);
</code></pre>
<p dir="auto">questa è la nuova:</p>
<pre><code class="language-php">$q  = "insert into anag_dip (";
$q .= "    id_utente";
$q .= "   ,id_azienda";
$q .= "   ,cognome";
$q .= "   ,nome";
$q .= "   ,data_nascita";
$q .= "   ,citta_nascita";
$q .= "   ,codice_fiscale";
$q .= "   ,citta_residenza";
$q .= "   ,indirizzo";
$q .= "   ,cap";

$q .= "   ,stato_civile";//nuovo campo
$q .= "   ,stato_dip";//nuovo campo
$q .= "   ,qualifica";//nuovo campo
$q .= "   ,tratt_irpef";//nuovo campo
$q .= "   ,part_full";//nuovo campo
$q .= "   ,t_det_i";//nuovo campo
$q .= "   ,pos_inps";//nuovo campo
$q .= "   ,matr";//nuovo campo
$q .= "   ,add";//nuovo campo
$q .= "   ,liv";//nuovo campo
$q .= "   ,data_ass";//nuovo campo
$q .= "   ,cod_qual";//nuovo campo

$q .= "   ,altri_dati_dip1";
$q .= "   ,altri_dati_dip2";
$q .= "   ,altri_dati_dip3";
$q .= "   ,altri_dati_dip4";
$q .= "   ,altri_dati_dip5";
$q .= "   ,altri_dati_dip6";
$q .= "   ,altri_dati_dip7";
$q .= "   ,altri_dati_dip8";
$q .= "   ,altri_dati_dip9";
$q .= "   ,altri_dati_dip10";
$q .= "   ,altri_dati_dip11";
$q .= "   ,altri_dati_dip12";
$q .= "   ,altri_dati_dip13";

$q .= " ) values (";
$q .= "    (SELECT user_id FROM tbl_users WHERE user_name = '" . $_SESSION['logged'][0] . "')";
$q .= "   ,'" . $_POST['dittas'] . "'";
$q .= "   ,'" . addslashes(trim($_POST['cognome'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['nome'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['data_nascita'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['citta_nascita'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['codice_fiscale'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['citta_residenza'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['indirizzo'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['cap'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['stato_civile'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['stato_dip'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['qualifica'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['tratt_irpef'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['part_full'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['t_det_i'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['pos_inps'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['matr'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['add'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['liv'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['data_ass'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['cod_qual'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip1'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip2'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip3'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip4'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip5'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip6'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip7'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip8'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip9'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip10'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip11'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip12'])) . "'";
$q .= "   ,'" . addslashes(trim($_POST['altri_dati_dip13'])) . "'";

$q .= " )";

$anag = mysql_query($q) or die (mysql_error());
</code></pre>
<p dir="auto">eppure nel database i campi sono tutti inseriti</p>
]]></description><link>https://dev.connect.gt/topic/62825/errore-di-sintassi</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 11:02:52 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/62825.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Feb 2008 10:02:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to errore di sintassi on Thu, 07 Feb 2008 16:03:31 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><strong>Thedarkita</strong></p>
<p dir="auto">Stai mischiando insert e select O.o<br />
ti consiglio di rivedere il funzionamento di entrambi...</p>
</blockquote>
<p dir="auto">Grazie, il problema era nel nome della variabile che avevo stabilito: "add".<br />
Andava messo tra apici altrimenti faceva casino con mysql...<br />
Ho cambiato nome, ora va...anche se devo capire bene il problema...<br />
Grazie comunque... Ciao</p>
]]></description><link>https://dev.connect.gt/post/680754</link><guid isPermaLink="true">https://dev.connect.gt/post/680754</guid><dc:creator><![CDATA[maubox8]]></dc:creator><pubDate>Thu, 07 Feb 2008 16:03:31 GMT</pubDate></item><item><title><![CDATA[Reply to errore di sintassi on Thu, 07 Feb 2008 15:35:16 GMT]]></title><description><![CDATA[<p dir="auto">Stai mischiando insert e select O.o<br />
ti consiglio di rivedere il funzionamento di entrambi...</p>
]]></description><link>https://dev.connect.gt/post/680753</link><guid isPermaLink="true">https://dev.connect.gt/post/680753</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Thu, 07 Feb 2008 15:35:16 GMT</pubDate></item></channel></rss>