Current location: Hot Scripts Forums » Programming Languages » PHP » PHP Repeat Sequence


PHP Repeat Sequence

Reply
  #1 (permalink)  
Old 11-05-04, 12:25 PM
bayside bayside is offline
Newbie Coder
 
Join Date: Jun 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Repeat Sequence

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="javascriptopImage('<? 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="javascriptopImage('<? echo $row['Pix1'] ?>')"><img border=0 src=<? echo $row['Pix1'] ?>.jpg width=50 height=50></a>
<a href="javascriptopImage('<? echo $row['Pix2'] ?>')"><img border=0 src=<? echo $row['Pix2'] ?>.jpg width=50 height=50></a>
<a href="javascriptopImage('<? echo $row['Pix3'] ?>')"><img border=0 src=<? echo $row['Pix3'] ?>.jpg width=50 height=50></a>
<a href="javascriptopImage('<? echo $row['Pix4'] ?>')"><img border=0 src=<? echo $row['Pix4'] ?>.jpg width=50 height=50></a>
<a href="javascriptopImage('<? echo $row['Pix5'] ?>')"><img border=0 src=<? echo $row['Pix5'] ?>.jpg width=50 height=50></a></center>
</td></tr></table></center><p>

<?
}

?>
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
Mouseover with Single PHP page rjwebgraphix PHP 7 09-16-04 05:15 PM
php with Apache in windows eDevil PHP 3 08-08-04 12:03 AM
100 Web Templates & 10 PHP Scripts for sale! HostersUK.co.uk General Advertisements 0 01-10-04 12:31 AM
Realtime PHP Code Obfuscation barrywien General Advertisements 1 11-16-03 06:50 PM


All times are GMT -5. The time now is 05:12 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.