Codice PHP:
function comment ($id){
mysql_connect($this->server, $this->db_user, $this->db_pass);
mysql_select_db($this->database);
$query = mysql_query("SELECT comment.id, comment.username, comment.comment , comment.postid , DATE_FORMAT(comment.date, '%d/%m/%y') AS timestamp, user.avatar FROM comment, user WHERE comment.postid='$id' ORDER BY comment.id DESC");
while($array = mysql_fetch_array($query)){
if($array["avatar"] ===""){
$array["avatar"] = "http://p3e2.altervista.org/avatar.gif";
}
echo ("<h2>$array[id] - $array[username] [i]$array[timestamp][/i] <img src=\"$array[avatar]\" /></h2>$array[comment]
");
}
}
Con questa funzione ottengo lo stesso commento per due volte!!! Dove sbaglio???