repeating data from one column until data from another column changes
| From: | msa | Date: | Tue, 04 May 2004 19:15:10 +0000 |
| Subject: | repeating data from one column until data from another column changes | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-185334@lists.php.net to get a copy of this message | ||
The page that I am having problems with is:
www.aiaky.org/news3.php
the titles in the main section, upper right, are only supposed to be the
titles from any record containing the most current date in the date column
(which right now is April 1, 2004).
Under the text "E-News April 1, 2004" there is supposed to be the articles
listed (ORDER 'sort' DESC) but again, only the articles that have the most
current date in the date column.
The table (ArchiveNews) contains the following fields:
ID - primary
date
sort
title
description
If you look at: www.aiaky.org/news.php you will see how I want the problem
page to work. The working page has a connection to a table that ONLY
contains the current month's news. But I need to automate the news so that
once the client updates the current news, the old news jumps over to the
archive page....which I have working at: www.aiaky.org/newsArchives3.php
Here is the code for the center section of the problem page:
<td rowspan="2" class="content"><h2>News</h2>
<p> </p>
<table class="eMenu" cellspacing="0">
<tr>
<td><?php do { ?>
<a href="#<?php echo $row_rsENews['sort']; ?>"
class="eMenu"><?php
echo $row_rsENews['title']; ?></a>
<?php } while ($row_rsENews = mysql_fetch_assoc($rsENews)); ?>
</td>
</tr>
</table>
<h3>E-News <?php
$theYear = substr($row_rsLatestDate['date'], 0, 4);
$theMonth = substr($row_rsLatestDate['date'], 5, 2);
$theDay = substr($row_rsLatestDate['date'], 8, 2);
$timestamp = mktime(0, 0, 0, $theMonth, $theDay, $theYear);
echo date('F j, Y', $timestamp);
?></h3>
<?php do { ?>
<h4><a name="<?php echo $row_rsENews['sort'];
?>"></a><br>
<?php echo $row_rsENews['title']; ?></h4>
<p><?php echo $row_rsENews['description']; ?></p>
<p><a href="#top">top</a><br>
</p>
<?php } while ($row_rsENews = mysql_fetch_assoc($rsENews)); ?>
end code
Any help is greatly appreciated!!!