ciao a tutti!!! l'errore è certamente qua: WHERE U.nick = $nome;
ma non capisco dove
grazieCodice PHP:$query = "SELECT F.file,F.voto,F.id,F.commento,
U.nic
FROM mp3 AS F,
utenti AS U
WHERE U.nick = $nome
ORDER BY F.voto DESC
LIMIT $start,$step";
![]()
ciao a tutti!!! l'errore è certamente qua: WHERE U.nick = $nome;
ma non capisco dove
grazieCodice PHP:$query = "SELECT F.file,F.voto,F.id,F.commento,
U.nic
FROM mp3 AS F,
utenti AS U
WHERE U.nick = $nome
ORDER BY F.voto DESC
LIMIT $start,$step";
![]()
Sì, in effetti uno degli errori è lì. Immagino sia una stringa, perciò:Originariamente inviato da iacoposk8
ciao a tutti!!! l'errore è certamente qua: WHERE U.nick = $nome;
ma non capisco dove
grazieCodice PHP:$query = "SELECT F.file,F.voto,F.id,F.commento,
U.nick
FROM mp3 AS F,
utenti AS U
WHERE U.nick = $nome;
ORDER BY F.voto DESC
LIMIT $start,$step";
$result = mysql_query($query, $db);
![]()
WHERE U.nick LIKE '$nome'; se vuoi che trovi la stringa esatta
WHERE U.nick LIKE '$nome%'; se vuoi che trovi una stringa che comincia come la tua variabile
WHERE U.nick LIKE '%$nome'; se vuoi che trovi una stringa che finisca come la tua variabile
WHERE U.nick LIKE '%$nome%'; se vuoi che trovi una stringa che contenga la tua variabile
Per il resto leggi da manuale come si fanno le JOIN
effettivamente mancava anche un altra condizione
ma così va
grazieCodice PHP:$query = "SELECT F.file,F.voto,F.id,F.commento,
U.nick
FROM mp3 AS F,
utenti AS U
WHERE U.nick LIKE '$nome'
AND F.iduser = U.id
ORDER BY F.voto DESC
LIMIT $start,$step";