logo spacer

Design Resources

mascot
spacer icon menu spacer
spacer
You are here: bulletHome > Design Resources > Horiz. Loop.



Website Design Logo

Colour Key:

  • || Page Links
  • a. Site Menu
  • || Emphasis Only

 


bulletPHP/MySql Horizontal Looping Recordset

Page 1, 2.

Checking Out The Code

<html>
<body>
<table>

<?php

// instantiate horizontal var

$doHorizontal = 0;

// begin the repeat region

do {

// post-increment horizontal var

$doHorizontal++;

// if this is the first record, echo a <tr> tag

if ($doHorizontal == 1){
echo "<tr>";
}
?>

<td>Record Value = <?php echo $row['columnName'] ; ?></td>

// if $doHorizontal equals the number of colums we want,
// (3 in this case) close the table row with </tr>

<?php
if ($doHorizontal == 3) {
echo "</tr>";

// reset var to 0 for next table row of records

$doHorizontal = 0;
}

// keep going till all records are outputted

} while ($row_rsNames = mysql_fetch_assoc($rsNames));
?>

</table>
</body>
</html>

Horizontal Looping RecordSet
Record Value = 1 Record Value = 2 Record Value = 3
Record Value = 4 Record Value = 5 Record Value = 6
Record Value = 7 Record Value = 8 Record Value = 9

 

Enjoy!

... Design Resource Index :: This Tutorial Page 1, 2.

 

 

spacer spacer
Copyright © 2005 v2Media All Rights Reserved.
By using this Website, you agree with our Terms and Conditions.

www.v2media.biz contact details;
phone: +61 7 5665 8808 mobile: +61 0407 133805 email: sales@v2media.biz