Re: repeating data from one column until data from another column changes
| From: | Torsten Roehr | Date: | Tue, 04 May 2004 18:42:16 +0000 |
| Subject: | Re: repeating data from one column until data from another column changes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185338@lists.php.net to get a copy of this message | ||
"Msa" <melissa@maddesignusa.com> wrote in message
news:20040504181618.30239.qmail@pb1.pair.com...
> 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.
I'm not quite sure if I understand your problem. Why don't you "ORDER BY
date desc LIMIT 0, 1" to only load the latest article? Maybe you could post
some rows of your table and show which of them you would like to load.
Regards, Torsten
>
> 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!!!