PhpHtmlDeveloperEXPERT PhpHtmlDeveloperEXPERT - 2 months ago 7x
PHP Question

anyone know why I keep getting duplicate images

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, header.username, images.message,
   FROM images
   INNER JOIN header
   ON images.message=header.file 
   group by; ";
  • you missed to GROUP BY image id to dont get dublicates