Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Show recent records on news page and older records on archive page

Posted on 2008-10-03
3
Medium Priority
?
175 Views
Last Modified: 2010-04-25
Hi,

I have a 'news page' with the most recent (say this months') records listed. I need to create an 'archive page' with the continuation of those records listed (after this months').

This link shows example:-
http://www.whrproperty.co.uk/articles.asp?pagekey=116
(link to 'archive' at the bottom of the page)

This is my actual page:-
http://www.propertyalliancegroup.com/new_site/news.php
0
Comment
Question by:kaz0161
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Expert Comment

by:jtdebeer
ID: 22638239
Copy your page news.php and name it archiveNews.php,

Now change both your database queries to include a date filter. ie

Select * from News where date > (Select getdate()-30)) on the News.php page
and
Select * from News where date <= (Select getdate()-30))

That is if you have a date coloumn on your table.


Have fun
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 22638244
Hi kaz0161,

You would need to store all news entries in a mysql table and use PHP and mysql queries to pull them out as desired.  

What exactly is your question?
0
 

Accepted Solution

by:
kaz0161 earned 0 total points
ID: 22638406
I have a mysql table which is called 'property', 'date' is my column and it is all populated. I am using dreamweaver but am struggling with how to use php and mysql queries to get one page of recent records and one page of the continued older records.

A friend suggested this:-

$newstime = mktime(0, 0, 0, date("m")-2, date("d"),   date("Y")); // Change the 2 to the number of months ago you want
$query_rs_Images = "SELECT id, filename, heading, `description` FROM news WHERE date > ".$newstime." ORDER BY date DESC";

I shall try your suggestion jtdebeer (yours seems less complicated) and will get back to you tommorrow when im in work. Hopefully all will be well.

Thankyou.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question