
December 3rd, 2012, 02:03 PM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 7
Time spent in forums: 2 h 5 m 38 sec
Reputation Power: 0
|
|
PHP-General - PHP Query Assistant
Hi Everyone,
I'm new to this code, however, am trying to learn.
Recently had a website built and there was some PHP used within it - some of it I understand, some of it I don't.
This is a news page article (darlingtontowntwinning.co.uk/testing.php).
As you can see the news just keeps appearing on the right hand side.
What I am looking to do, is to limit the amount of news that appears on the page (say until the 1/1/12) and then for all articles to display (either on the same or a different page) when "See More News" is clicked from the bottom of the list.
I've been told that I'll need a WHERE query added into the code, I just can't work out where.
If you guys could help, that'd be great!
Code:
<div id="right" class="news">
<h3>Archive</h3>
<? $news=$session->getNews("","","",1);?>
<? while($article=mysql_fetch_array($news)){?>
<?
$date = $article['thedate'];
$year = date('Y', $date);
$month = date('F', $date);
?>
<h4><?=$month." - ".$year;?></h4>
<nav class="small">
<? $innernews=$session->getNews("",$month,$year);?>
<? while($innerarticle=mysql_fetch_array($innernews)){?>
<a href="/news/<?=$innerarticle['ftitle']?>" <? if($title==$innerarticle['ftitle']){?> class="active"<? }?>><?=$innerarticle['title']?></a>
<? }?>
</nav>
<? }?>
</div>
|