Codice PHP:
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
la tua query effettua a grandi linee la seguente ricerca, cerca i dati dentro comment che corrispondano ad un determinato id e poi tutti i dati della table user.
questo avviene perche' non hai una chiave che unisce la table user con la table comment. Hai mandato al database un riferimento solo su comment e non su user quindi in parole povere ti pesca un dato su comment e tutti i dati su user.
per risolvere il problema dovresti mettere una chiave su comment , ad esempio userid che corrisponde all'id di un utente su user table e trasformare la query in
Codice PHP:
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' AND comment.userid = user.id ORDER BY comment.id DESC
oppure usare una JOIN