Its suppose to be a gallery that displays images from two joined tables. Somehow two duplicate images instead of one keeps popping up. It only happens when I joined the tables. Is there a way to prevent this using javascript or some php code. I'm I doing something wrong.
change your query to this.
$sql = " SELECT images.id, header.username, images.message, images.name
FROM images
INNER JOIN header
ON images.message=header.file
group by images.id; ";
GROUP BY
image id to dont get dublicates