Salve ragazzi. Ho un problema. Vi mostro subito il codice. Questo è script.php.
codice:<? include "../config.php"; include "controllo.php"; $id1 = $_GET['id1']; $numero = $_GET['numero']; $sponsor = $_GET['sponsor']; $utente = $_GET['utente']; $query_uno = "SELECT * FROM utenti WHERE id = '$utente'"; $result_otto = mysql_query($query_uno, $db) or die('Errore query tre: ' . mysql_error()); $query_tre = "UPDATE utenti SET $sponsor=1 WHERE numero = '$numero'"; $result_uno = mysql_query($query_tre, $db) or die('Errore query tre: ' . mysql_error()); $query_due = "DELETE FROM signups WHERE id = $id1"; $result_due = mysql_query($query_due, $db) or die('Errore query due: ' . mysql_error()); header("Location: approva_ultimi.php?pag=1"); ?>
Ecco il codice della pagina precedente:
Quando clicco su uno dei link mi da questo errore:codice:$query = "SELECT * FROM signups ORDER BY id"; $result = mysql_query($query, $db); while($row = mysql_fetch_array($result)) { echo "<tr><td align='center'>$row[id]</td> <td align='center'>$row[numero]</td> <td align='center'>$row[sponsor]</td> <td align='center'>$row[utente]</td> <td align='center'>[img]si.png[/img] [img]no.png[/img]</td> </tr>"; } ?>
Errore query tre: 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 '=1 WHERE numero = ''' at line 1
Sapete aiutarmi? C'è qualche errore nel codice?

Rispondi quotando