PHP Question

Permabanned
Joined
22 Apr 2007
Posts
1,805
So I have my news page set up where a snippet of the article is shown on the news page and then the user clicks on the "view article" link and it takes them off to the full article.

I also would like a news archive, probably called newsarc.php

In here, I want it to look the same as the news page but have the months listed down the right hand side and the individual months news on the left

i.e. so that all the news from october shows on the left rather than showing all the news stored in the database.

I'd be grateful for some help.
 
That is a pretty vague question, will probably need more information like DB structure etc
 
I've said it before, and I'll say it again. You're asking really broad questions that could easily be answered if you had a basic knowledge of the language, and how database driven web applications work. If you did a few tutorials on php and mysql, you'd be able to answer these questions yourself.

I'm sure someone will answer your problem for you, but in the long run, it won't help you.
 
I agree with Sic on this. Given the amount of threads you have created lately you should have learned something.
 
:(

I kind of have it working, but I'm stuck on how to display just the months news when the appropriate month is clicked.

On the main news page its easy as its sorted by id descending. (I have an id field in my table)

I dont have a date field though so I wonder if that might help make things easier?
 
:(

I kind of have it working, but I'm stuck on how to display just the months news when the appropriate month is clicked.

On the main news page its easy as its sorted by id descending. (I have an id field in my table)

I dont have a date field though so I wonder if that might help make things easier?

If you don't have a date field then it is pretty much impossible to organise by date? Also the majority of news posting systems use dates to let the user know how recent the update is. No good having a post saying 'Christmas Stock Now In' when it was posted christmas 2005 and not being able to tell that at a glance
 
If you don't have a date field then it is pretty much impossible to organise by date?

agree with the rest of your post, but if you've got an auto-increment id field, you can order chronologically - that's about the extent of it though.
 
agree with the rest of your post, but if you've got an auto-increment id field, you can order chronologically - that's about the extent of it though.

While true it doesn't give much information to the user. Sale X might have happened after Sale Y, but when did these sales happen? Are they still on?
 
OK, I have an ID field and then the title field is the date, manually entered as text 'varchar'

So I'll add a date field to the table and have a crack
 
The title field is the date?

If you are going to have a date field there is absolutely no reason to repeat the date in the title. Keep the title to just being a title.

When you generate your page, you can combine the title and date with the PHP.
 
Back
Top Bottom