Re: Re: repeating data from one column until data from another column changes

From: Date: Tue, 04 May 2004 21:53:43 +0000
Subject: Re: Re: repeating data from one column until data from another column changes
References: 1 2 3 4 5 6 7 8 9  Groups: php.general 
Request: Send a blank email to php-general+get-185362@lists.php.net to get a copy of this message
"Msa" <melissa@maddesignusa.com> wrote in message news:20040504214559.13290.qmail@pb1.pair.com... > > "Daniel Clark" <dclark@nwlink.com> wrote in message > > news:51606.65.203.232.102.1083706708.squirrel@webmail.pacifier.com... > > Are you looping through the record set? > > i thought I was, but it isn't working!! > > here is the code with all of the latest suggestions..... > > start code at top of document: > <?php require_once('Connections/jpike.php'); ?> > <?php > mysql_select_db($database_jpike, $jpike); > $query_rsENews = 'SELECT * FROM NewsArchive WHERE YEAR(date) = ' . date('Y') > . ' AND MONTH(date) = ' . date('m') . ' ORDER BY sort DESC'; > $rsENews = mysql_query($query_rsENews, $jpike) or die(mysql_error()); > $row_rsENews = mysql_fetch_assoc($rsENews); The above line is already fetching the first row from the result. Is this what you want at this point of the script? If not put // in front to out ocmment it. > $totalRows_rsENews = mysql_num_rows($rsENews); Please print out $totalRows_rsENews and post the value. Have you checked if you have articles with a May date? Torsten > ?> > > end top code > > start code in body of document: > > <table class="eMenu" cellspacing="0"> > <tr> > file://this is where I would like to list the titles of the articles for the > current month > <td><?php do { ?> > <a 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> > file://this is where i want the list to be title and article for > the current month > <?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 > > > I didn't hand write much of this....dreamweaver writes a lot of it behind > the scenes.....i'm not much of a code writer, just get into small needs here > and there...REALLY appreciate all of you trying to help me!!!

« previous php.general (#185362) next »