Loop Qoustion
Posted: Thu Apr 30, 2009 2:27 pm
Hello I did this script and my problem is I have 13 entries in the data base but it show me only 12
Code: Select all
<?php
include "contact.php";
$query = "SELECT * FROM staff ";
$result = mysql_query($query);
$tbl= "<table align = center ><tr>";
$AA=0;
while
(
$row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$fname=$row['firstname'];
$lname=$row['lastname'];
$phone =$row['ext'];
$email =$row['emil'];
$photo =$row['pic'];
$title=$row['title'];
if ($AA<6) {
$tbl.="<td><img src=$photo width=98 height=98 <br> <span class=style2> $fname $lname</span><br><span class=style5>$title<br> Ext.$phone $AA</td>";
$AA++;
}
else{
$tbl.="</tr><tr>";
$AA=0;
}
}
echo $tbl
?>