-
Salve a tutti,
ottengo il seguente errore:
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 '' at line 6nella seguente query:
//SELEZIONE TUTTE LE FOTO DEL CONTEST E VERIFICO SE C'E' IL FILTRO PER UTENTE $filter_by_user = "AND CompetitorID = " . $getCurrentUser. " "; $qq_foto = "SELECT * FROM works_2014 WHERE ContestID = " . $currentContest['ID'] . " " . $filter_by_user; $q_foto = mysql_query($qq_foto) or die (mysql_error());secondo voi dov'è l'errore?
Grazie.
-
felino
Salve a tutti,
ottengo il seguente errore:
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 '' at line 6nella seguente query:
//SELEZIONE TUTTE LE FOTO DEL CONTEST E VERIFICO SE C'E' IL FILTRO PER UTENTE $filter_by_user = "AND CompetitorID = " . $getCurrentUser. " "; $qq_foto = "SELECT * FROM works_2014 WHERE ContestID = " . $currentContest['ID'] . " " . $filter_by_user; $q_foto = mysql_query($qq_foto) or die (mysql_error());secondo voi dov'è l'errore?
Grazie.
Forse è un problema di virgolette mancanti nei valori della query. Cosa ti riporta se fai un echo di $qq_foto?
//SELEZIONE TUTTE LE FOTO DEL CONTEST E VERIFICO SE C'E' IL FILTRO PER UTENTE $filter_by_user = "AND CompetitorID = '" . $getCurrentUser. "' "; $qq_foto = "SELECT * FROM works_2014 WHERE ContestID = '" . $currentContest['ID'] . "' " . $filter_by_user; echo $qq_foto; // DEBUG $q_foto = mysql_query($qq_foto) or die (mysql_error());Ti ho aggiunto anche le virgolette....
-
Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.
Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.
Con il tuo contributo, questo post potrebbe essere ancora migliore 💗
Registrati Accedi
