<?php error_reporting(7); require("./global.php"); $getattachments=$DB_site->query("SELECT attachmentid FROM attachment WHERE userid=$userid"); while ($thumbnails=$DB_site->fetch_array($getattachments)) { echo "<img src=\"attachment.php?attachmentid=".$thumbnails['attachmentid']."\" width=\"30\" height=\"30\"><br>"; } ?>