This loop does not show images from the database and show only one record .. where is the problem And how can i make the id changes with loop This loop to show per line two records but how the show every time a different record, such as the latest news and log appear according to the latest news added to the database?
<table class=" table" align="center">
<tr>
<?php
$conn=mysql_connect("localhost","root","1");
mysql_select_db("society",$conn);
$query="SELECT * FROM news ORDER BY id asc ";
$result=mysql_query($query) or die(mysql_error());
$max = 2;
$num = 0;
while((($rows=mysql_fetch_row($result))>$num )){
$num++;
?>
<td class="NewsListTD">
<?php $m = new myclass();
echo $m->gettitle(id); ?>
<?php $m = new myclass();
echo $m->getcontent(id);
echo" <img src='images/$row[pic]' width='60' height='60' />";?>
</td>
<?php
if ($num == $max){
echo "</tr>";
$num = 0;
}
}
?>
</tr>
</table>