
Chris
Staff

Aug 13, 2009, 12:55 PM
Post #4 of 9
(2897 views)
Shortcut
|
|
Re: [thenetgirl] List in a table display
[In reply to]
|
Can't Post
|
|
Hi thenetgirl, To filter records during a foreach, you can skip records if the record doesn't match a certain condition. Add the following code directly after each <?php foreach ... ?>, adjusting the city you're matching for:
<?php if ($record['City'] !== "Pebble Beach") { continue; } ?> I hope this helps! Please let us know if you have any questions or comments. P.S. You'll want to move your foreach and endforeach outside of your <tr></tr> tags so your tables don't get messed up. For example:
<table> <tr> ...column headers here... </tr> <?php foreach ... ?> <?php if ($record['City'] !== "Pebble Beach") { continue; } ?> <tr> ...display listing here... </tr> <?php endforeach ?> </table> Chris
(This post was edited by chris on Aug 13, 2009, 12:56 PM)
|