echo "<table cellpadding='0' cellspacing='0'> 
<tr>"; 
$result = mysql_query("SELECT * FROM images WHERE $pop LIKE '$ida' ORDER BY id ASC"); 
while($r=mysql_fetch_array($result)){ 
$img=$r["url"]; 
echo "<td valign=top align=center><a rel='nofollow'  href='show.php?id=$ida'><img border='0' src='$img' width='$wi' height='$wi'><br>$postname</a><br>$text</td>"; 
    $listele++; 
    if($listele % 4 == 0){ 
    echo "</tr><tr>"; 
    }  
} 
echo "</tr></table>";