Question
If-condition and Repeat Region
In the sidebar I want to list the articles whose number is
"3" or more
or which are without any number, whereas in the main content the
articles with numbers "1" or "2" should be listed.
So I have in the maincontent:
<?php do { ?>
<?php if ($row_rsFirstpage['main_number'] < 3 ) { ?>
<p><?php echo $row_rsFirstpage['main_text']; ?></p>
<? } ?>
<?php } while ($row_rsFirstpage = mysql_fetch_assoc($rsFirstpage)); ?>
and in the sidebar:
<?php do { ?>
<?php if ($row_rsFirstpage['main_number']=="" ||
$row_rsFirstpage['main_number'] > 2 ) { ?>
<li><?php echo $row_rsFirstpage['main_text']; ?></li>
<? } ?>
<?php } while ($row_rsFirstpage = mysql_fetch_assoc($rsFirstpage)); ?>
Why doesn't that code work. Well, I could use two recordsets but would
like to get a result with only one.
Martin
or which are without any number, whereas in the main content the
articles with numbers "1" or "2" should be listed.
So I have in the maincontent:
<?php do { ?>
<?php if ($row_rsFirstpage['main_number'] < 3 ) { ?>
<p><?php echo $row_rsFirstpage['main_text']; ?></p>
<? } ?>
<?php } while ($row_rsFirstpage = mysql_fetch_assoc($rsFirstpage)); ?>
and in the sidebar:
<?php do { ?>
<?php if ($row_rsFirstpage['main_number']=="" ||
$row_rsFirstpage['main_number'] > 2 ) { ?>
<li><?php echo $row_rsFirstpage['main_text']; ?></li>
<? } ?>
<?php } while ($row_rsFirstpage = mysql_fetch_assoc($rsFirstpage)); ?>
Why doesn't that code work. Well, I could use two recordsets but would
like to get a result with only one.
Martin
