Cos'è questa roba? Non ti sembra il caso di fare una mysql_query()?Originariamente inviato da cactua
Codice PHP:...
$query = "SELECT * FROM 'Tournaments' ORDER BY id LIMIT 0,9";
if (!$query) die("errore nella query");
while($row = mysql_fetch_array($query)){
...
$creatore = "SELECT * FROM 'Users' Where id = '".$torneo['creatore']."' ORDER BY id LIMIT 1";
$creatore = mysql_fetch_row($creatore);
...
$gioco = "SELECT * FROM 'Games' Where id = '".$torneo['gioco']."' ORDER BY id LIMIT 1";
$gioco = mysql_fetch_row($gioco);
...
$console = "SELECT * FROM 'Console' Where id = '".$torneo['console']."' ORDER BY id LIMIT 1";
$console = mysql_fetch_row($console);
...
$dati[] = $torneo;
//fine ciclo
}
return $dati;
}
Studia :
L'array ti resta vuoto come minimo perchè la funzione mysql_fetch_array() in
while($row = mysql_fetch_array($query))
genera un errore, dato che si aspetta che il suo parametro sia un id di risorsa e non una stringa come fai tu, e ritorna false... ovveorosia il ciclo non viene mai eseguito.
![]()

Rispondi quotando