I am trying to make the following extract repeat 5 times on a page then offer another page to view more results. Currently this script is running all 25 tables. I would prefer only 5 per page. Any help would be appreciated.
<?PHP
if(mysql_connect('localhost', 'root', 'password' )){
print("");
}else{
print("connection failed");
}
if (! @mysql_select_db( 'ActionRealty' ) ) {
die( '<p>Unable to locate the Action Realty Listings ' .
'Database at this time.</p>' );
}
$result = @mysql_query(
'SELECT MLS, Price, Address, City, Zip, PropertyType, Details, Beds, Baths, SqFt, Acres, Image, Pix1, Pix2, Pix3, Pix4, Pix5, Pix6, Pix7, Pix8, Pix9, Pix10
FROM Listings' );
if (!$result) {
die( '<p>Error performing query: ' . mysql_error() .
'</p>' );
}
while ( $row = mysql_fetch_array($result) ) {
?>
<center><table bgcolor="#ffffcc" width=600 border=0 cellspacing=3 cellpadding=0>
<tr>
<td width=150 align=center valign=center>
<a href="javascript

opImage('<? echo $row['Image'] ?> ','<? echo $row['Address'] ?>')"><img border=0 src=<? echo $row['Image'] ?>.jpg width=150 height=113></a>
</td>
<td width=150 align=center valign=center>
<b>Address</b><br>
<? echo $row['Address'] ?><br>
<? echo $row['City'] ?> Fl. <? echo $row['Zip'] ?>
<p>
<b>Price <? echo $row['Price'] ?></b><br>
<b>MLS # <? echo $row['MLS'] ?></b>
</td>
<td width=150 align=center valign=center>
<b>Property Description</b><br>
<? echo $row['PropertyType'] ?>
<p>
<a href="/contact-us.html"><font color="#003366"><b>Schedule a viewing</b></a></font></td>
<td width=150 align=center valign=center>
<b>Details</b><br>
Bedrooms:<? echo $row['Beds'] ?>
<br>
Bathrooms:<? echo $row['Baths'] ?>
<br>
Sq. Ft.: <? echo $row['SqFt'] ?>
<br>
Acreage: <? echo $row['Acres'] ?>
</td></tr></table></center>
<center><table width=600 border=0 cellspacing=0 cellpadding=0>
<tr>
<td bgcolor="#ffffff" width=600 align=left valign=center>
<? echo $row['Details'] ?><br>
<center>
<a href="javascript

opImage('<? echo $row['Pix1'] ?>')"><img border=0 src=<? echo $row['Pix1'] ?>.jpg width=50 height=50></a>
<a href="javascript

opImage('<? echo $row['Pix2'] ?>')"><img border=0 src=<? echo $row['Pix2'] ?>.jpg width=50 height=50></a>
<a href="javascript

opImage('<? echo $row['Pix3'] ?>')"><img border=0 src=<? echo $row['Pix3'] ?>.jpg width=50 height=50></a>
<a href="javascript

opImage('<? echo $row['Pix4'] ?>')"><img border=0 src=<? echo $row['Pix4'] ?>.jpg width=50 height=50></a>
<a href="javascript

opImage('<? echo $row['Pix5'] ?>')"><img border=0 src=<? echo $row['Pix5'] ?>.jpg width=50 height=50></a></center>
</td></tr></table></center><p>
<?
}
?>