I'm having an issue with a mod I'm creating for my site. Right now I have it saving screenshots to the database along with files. When you view the page, it lists the first file in the db twice and since it has 2 screenshots, the first duplicate shows one screenshot, then the second duplicate shows 2 screenshots.
Here is the code:
PHP Code:
$query = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "download AS download
LEFT JOIN " . TABLE_PREFIX . "download_screenshots AS screenshots ON (screenshots.file_id = download.id)");
while ($dl = $db->fetch_array($query))
{
$id = $dl['id'];
$version = $dl['version'];
$name = $dl['name'];
$size = $dl['size'];
$description = $dl['description'];
$username = $dl['username'];
$userid = $dl['userid'];
$sid = $dl['sid'];
$screenshot = $dl['sdata'];
eval('$display_shots .= "' . fetch_template('bfc_download_screenshot_display') . '";');
eval('$display_bit .= "' . fetch_template('bfc_download_bit') . '";');
}
$navbits = array();
$navbits[$parent] = 'Download :: Index';
$navbits = construct_navbits($navbits);
eval('$display = "' . fetch_template('bfc_download_main') . '";');
I have attached a screenshot for you to view.
As you can see from the screenshot, Your Linker.zip is the entry that shows up twice when I have checked the db and it is only in the db once.