PhpHtmlDeveloperEXPERT PhpHtmlDeveloperEXPERT - 1 year ago 59
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.

Answer Source

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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download