<?php
$sql="SELECT * from items WHERE stock='instock' AND name LIKE '%OFFER%' ORDER BY rand() LIMIT 12";
$result=mysql_query($sql);
echo "<table><tr>";
$i=13;
while($rows=mysql_fetch_array($result)){
$i = $i - 1;
if($i % 6 == 0)
{
echo "</tr><tr>";
} ?>
<td><table>
<tr>
<td><img src="<? echo $rows['image']; ?>" /></td>
</tr>
</table></td>
<td><?php } ?>
</td>
</tr>
</table>
took a lot out so sorry if there are any html errors 😃