hello there all im new to php ive done a bit of asp in the past and trying to learn as i go ive done a page so far my aims is to run throught the DB and put it in a table with every 3rd record add a new <td> that bit works ok i think and but getting to the forth record is the problem. the page runs but loops the first 3 records. any help would be great thank you heres my code
<?php
$dbconninfo = mysql_connect("localhost", "usrname", "pass");
$dbconnect = mysql_select_db("Ketya", $dbconninfo);
if ( $dbconnect == false )
{
echo mysql_error();
} else {
$sql = "SELECT * FROM Images";
$dbconnect = mysql_query( $sql );
if ( $dbconnect != false )
{
while ($rs = mysql_fetch_array($dbconnect))
{
$count=1;
while($count!=3)
{
if ($count==1){
echo "<tr align='center'>";
}
echo " <td>".$count."<img src='images/" .$rs['Cat']. "/" .$rs['Name']. "_sm.jpg' width=100' height='75' border='1'><br>" .$rs['Desc']. "</td>";
if ($count==2){
echo "</tr>";
echo " <tr height='10'>";
echo " <td colspan='3'><img src='images/spacer.gif' width='1' height='10'/></td>";
echo "</tr>";
}
$count++;
}
}
} else {
echo mysql_error();
}
}
?>[/SIZE]
thanks for the help