Jump to content

Recommended Posts

I have a standard repeat region that lists all records in a db. code follows:

<?php do { ?>
  <table width="100%" height="401" cellpadding="5" bordercolor="#2f291b">
    <tbody><tr>
      <td class="style2 style9" align="left" bgcolor="#2f291b" height="30" valign="top" width="46%"><table border="0" cellpadding="0" width="100%">
        <tbody><tr>
          <td class="style34"><?php echo $row_Recordset1['horsename']; ?></td>
          <td class="style35" align="right"><strong>
            <?php if ($price == "") { 
			echo ""; } else { 
		echo $price ;} ?><br><?php
				if ($auction == "") {
					echo "";} else {
				echo '<a href="'.$auction.'" target="_blank">Online Auction</a>';}?></strong></td>
          </tr>
          </tbody></table></td>
      <td rowspan="5" align="left" valign="top" width="54%"><table border="0" cellpadding="5" height="365" width="100%">
        <tbody><tr>
          <td colspan="2" align="left" valign="top">
            <font color="#fff8c5">
              </font><div class="style77">
                <font color="#fff8c5">                        	<font color="#fff8c5"><p class="style26" align="center">
                  <strong><?php echo $row_Recordset1['info_title']; ?></strong></p>
                  <span style="font-size: 12pt; line-height: 115%; font-family: "Verdana","sans-serif";">
                    <span class="style31"><?php echo $row_Recordset1['informationtext']; ?></strong><br><br>Call today for a delivery quote!</span></span></font></font></div>
            <font color="#fff8c5">								</font></td>
          </tr>
          <tr>
            <td align="center" bgcolor="#2f291b" valign="top" width="53%"><font face="Arial"><a href="http://www.ringcentral.com" target="Callback_RingMe" onclick='var wind = window; var winop = wind.open; winop("http://www.ringcentral.com/ringme/?uc=56014025,0,0&s=no&v=2", "Callback_RingMe", "resizable=no,width=380,height=240"); return false;'>
              <img src="images/click-to-call-small-o.gif" alt="click-to-call from the web" border="0" height="35" width="134" /></a></font></td>
            <td align="center" bgcolor="#2f291b" valign="top" width="47%"><span class="style6"><span class="style18">
              940-239-9230</span><br />
              <span class="style1">(24hrs a day)</span></span></td>
            </tr>
          </tbody></table>
        </td></tr>
      <tr>
        <td class="style2" align="center" bgcolor="#2f291b" valign="top"><font face="Arial"><span class="style23">
          <a href="horseinfo.php?id=<?php echo $row_Recordset1['idhorses']; ?>">
            <img src="images/moreinfo.jpg" border="0" height="41" width="328" /></a></span></font></td>
        </tr>
      <tr>
        <td class="style2" align="center" bgcolor="#2f291b" valign="top">
        <?php if ($headshot == "") {
		echo "<strong>Online Pictures Coming Soon!!!</strong>";} else {
          echo '<img src="horse_images/' . $headshot . '" height="213" width="300" />';}; ?>      </td>
        </tr>
      <tr>
        <td class="style2" align="center" bgcolor="#2f291b" valign="top">
          <a href="horseinfo.php?id=<?php echo $row_Recordset1['idhorses']; ?>">
            <img src="images/clicktowatch.jpg" border="0" height="40" width="328" /></a></td>
        </tr>
      <tr>
        <td></td>
        </tr>
      <tr>
        <td> </td>
        <td> </td>
        </tr>
      </tbody>
  </table>
  <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>

 

In the DB i also have a column that is active yes or no.  How would I tell the repeat region that if column entry for active = NO to skip that record in the repeat region and go to the next record.

 

Link to comment
https://forums.phpfreaks.com/topic/161213-repeat-region-help/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.