Hello, this code I’m using seems to just repeat the data for how ever much of the data I have, for example if I have fives rows of data, it will repeat itself 5 times and here is the PHP I’m using:
$dir = 'images/anime_shows/';
$file_display = array('jpg', 'jpeg', 'png', 'gif');
if (file_exists($dir) == false)
{
echo 'Folder \\'', $dir, '\\' not found!';
}
else
{
$dir_contents = scandir($dir);
foreach ($dir_contents as $file)
{
$file_type = strtolower(end(explode('.', $file)));
if ($file !== '.' && $file !== '..' && in_array($file_type, $file_display) == true)
{
$animeimg = '<img src="' . $dir . '/' . $file . '" alt="' . $file . '" width="80px;" height="100px" />';
$template->assign_block_vars('anime.img', array(
'IMG' => $animeimg,
));
$sql = "SELECT name, description FROM phpbb_anime" ;
$result = $db->sql_query($sql);
while (($row = $db->sql_fetchrow($result))>0)
{
$template->assign_block_vars('anime', array(
'ANIME_NAME' => $row['name'],
'ANIME_DESC' => $row['description'],
));
}
}
}
}