<?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[problema select]]></title><description><![CDATA[<p dir="auto">ciao a tutti.ho questo problema nel seguente file vorrei che prima che i dati venissero modificati e messi nel db vorrei fare con la select un controllo sull'username che non sia gia' in uso ma forse sbaglio qcosa</p>
<p dir="auto">&lt;?php<br />
//Connessione al database<br />
require_once('connessione.php');<br />
require_once('verify.php');</p>
<p dir="auto">$nomeMOD = @$_POST['nome'];<br />
$cognomeMOD = @$_POST['cognome'];<br />
$indirizzoMOD = @$_POST['indirizzo'];<br />
$cittàMOD = @$_POST['città'];<br />
$CAPMOD = @$_POST['CAP'];<br />
$telefono1MOD = @$_POST['telefono1'];<br />
$telefono2MOD = @$_POST['telefono2'];<br />
$emailMOD = @$_POST['email'];<br />
$sessoMOD = @$_POST['sesso'];<br />
$comunenascitaMOD = @$_POST['comunenascita'];<br />
$codicefiscaleMOD = @$_POST['codicefiscale'];<br />
$usernameMOD = @$_POST['username'];<br />
$username=$_SESSION['logged'][0];</p>
<p dir="auto">$query = "SELECT username FROM utenti WHERE username = '$username'";<br />
$result = mysql_query($query) or die("Errore nella query:".mysql_error());</p>
<p dir="auto">if (mysql_num_rows($result) &gt; 0){ // SE TROV UN UTENTE CON QUELL'USERNAME MI DICE CHE IN USO<br />
echo "echo "Il nome $username è in uso";"; }<br />
else{ echo "Il nome $username è in uso mod ok";;<br />
}</p>
<p dir="auto">$strSQL = "UPDATE utenti SET nome='$nomeMOD',cognome='$cognomeMOD',indirizzo='$indirizzoMOD',città='$cittàMOD',<br />
CAP='$CAPMOD',telefono1='$telefono1MOD',telefono2='$telefono2MOD',email='$emailMOD',<br />
sesso='$sessoMOD', comunenascita='$comunenascitaMOD',<br />
codicefiscale='$codicefiscaleMOD',username='$usernameMOD' WHERE username='$username'";</p>
<pre><code> mysql_query($strSQL);
</code></pre>
<p dir="auto">if(mysql_query($strSQL)) {<br />
echo "MODIFICA EFFETTUATA CON SUCCESSO";<br />
echo "&lt;br&gt;&lt;a href='homepage.php'&gt;Vai all' homepage dell'utente loggato&lt;/a&gt;";</p>
<p dir="auto">}</p>
<pre><code> else {die("PROBLEMI DURANTE LA MODIFICA DEI DATI");
</code></pre>
<p dir="auto">echo "&lt;br&gt;&lt;a href='modificadati.php'&gt;Torna indietro&lt;/a&gt;";<br />
}</p>
<p dir="auto">$_SESSION['logged'][0]=$usernameMOD;</p>
<p dir="auto">//Chiudo la connessione al db<br />
mysql_close();</p>
<p dir="auto">?&gt;</p>
]]></description><link>https://dev.connect.gt/topic/16287/problema-select</link><generator>RSS for Node</generator><lastBuildDate>Sat, 28 Nov 2026 21:48:46 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/16287.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 08 Sep 2006 12:14:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to problema select on Fri, 08 Sep 2006 14:08:31 GMT]]></title><description><![CDATA[<p dir="auto">mhm... ho spesso problemi pure io con gli statement SQL...</p>
<p dir="auto">prova a fare così select bla bla where username='".$username."'</p>
]]></description><link>https://dev.connect.gt/post/366491</link><guid isPermaLink="true">https://dev.connect.gt/post/366491</guid><dc:creator><![CDATA[joey.santiago]]></dc:creator><pubDate>Fri, 08 Sep 2006 14:08:31 GMT</pubDate></item><item><title><![CDATA[Reply to problema select on Fri, 08 Sep 2006 13:06:26 GMT]]></title><description><![CDATA[<p dir="auto">è solo errore copia incolla. ma la select è giusta?</p>
]]></description><link>https://dev.connect.gt/post/366514</link><guid isPermaLink="true">https://dev.connect.gt/post/366514</guid><dc:creator><![CDATA[fix]]></dc:creator><pubDate>Fri, 08 Sep 2006 13:06:26 GMT</pubDate></item><item><title><![CDATA[Reply to problema select on Fri, 08 Sep 2006 13:04:18 GMT]]></title><description><![CDATA[<p dir="auto">Dicevo dello spazio nel nome variabile. E' solo un refuso del copincolla o l'hai scritto nel codice?</p>
]]></description><link>https://dev.connect.gt/post/366503</link><guid isPermaLink="true">https://dev.connect.gt/post/366503</guid><dc:creator><![CDATA[massy]]></dc:creator><pubDate>Fri, 08 Sep 2006 13:04:18 GMT</pubDate></item><item><title><![CDATA[Reply to problema select on Fri, 08 Sep 2006 13:00:29 GMT]]></title><description><![CDATA[<p dir="auto">$usern ameMOD'<br />
è il valore modificato dell'<a href="http://username.ma" rel="nofollow ugc">username.ma</a> cosi come sta non riconosce se un username esiste o meno</p>
]]></description><link>https://dev.connect.gt/post/366512</link><guid isPermaLink="true">https://dev.connect.gt/post/366512</guid><dc:creator><![CDATA[fix]]></dc:creator><pubDate>Fri, 08 Sep 2006 13:00:29 GMT</pubDate></item><item><title><![CDATA[Reply to problema select on Fri, 08 Sep 2006 12:53:20 GMT]]></title><description><![CDATA[<p dir="auto">Tieni anche conto che dove fai il controllo, in caso di errore fai una echo ma poi il programma continua e fa l'UPDATE del record utenti.</p>
]]></description><link>https://dev.connect.gt/post/366501</link><guid isPermaLink="true">https://dev.connect.gt/post/366501</guid><dc:creator><![CDATA[margheritebianche]]></dc:creator><pubDate>Fri, 08 Sep 2006 12:53:20 GMT</pubDate></item><item><title><![CDATA[Reply to problema select on Fri, 08 Sep 2006 12:45:02 GMT]]></title><description><![CDATA[<p dir="auto">username='$usern  ameMOD'</p>
<p dir="auto">questo spazio è un refuso?</p>
]]></description><link>https://dev.connect.gt/post/366502</link><guid isPermaLink="true">https://dev.connect.gt/post/366502</guid><dc:creator><![CDATA[massy]]></dc:creator><pubDate>Fri, 08 Sep 2006 12:45:02 GMT</pubDate></item></channel></rss>