i am new in smarty and i have a little problem that i cant fetch images for my posts. I store the images path in table ( images ) and the posts in table (posts):
my php code is
$get_new_jobs=$mysqli->query("select id,numview,title,cat1,details,country,active from ads where country='".$country_en."' and active='1' order by id desc limit 4");
$nums=$get_new_jobs->num_rows;
while($row=$get_new_jobs->fetch_assoc()){
$mm[]=$row;
}
$smarty->assign('posts',$mm);
$smarty->assign('image',$the_images_name);
$smarty->display('posts.tpl');
and my images code is
$sql=mysqli->query("select adid,image,p from images where adid='".$row['id']."'");
$fet = $sql->fetch_assoc();
$the_images_name = $fet['image'];
and the tpl code is
<table width="100%" border="0" cellpadding="5">
{foreach from=$posts item=item}
<tr valign="top">
<td>
{$image}
<br />
{$item.title}
</td>
</tr>
{/foreach}
</table>
so how can i get each image for each post.
regards