|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How would you code a news script so it would print the date then print all the news of that date under it?
__________________
![]() ![]() "Only Linux users see the end of crashes." - Pl4t0 |
|
#2
|
|||
|
|||
|
Hmm, what you could do is create the current date, then when you query the database, add
WHERE date_field = $date and use the date fucntion to get date $date = date("Y-m-d"); |
|
#3
|
|||
|
|||
|
Are you saving the date of the news post into your database? If so, extract the date and continue with Ben's suggestion of assigning that date to a variable...
When you're extracting the news posts, make sure you extract the news items ONLY for that date ("WHERE newsDate = $date").
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#4
|
|||
|
|||
|
hm, I think he means to display news from more than one date at the time.. but have a headline for each date.. uh.. take a look at this site: http://www.rage3d.com/
__________________
Best Regards, Håvard Lindset |
|
#5
|
|||
|
|||
|
I mean what Lindset means ^
![]() |
|
#6
|
|||
|
|||
|
oh, hmmm.
what you could do is have another table which contains the dates of when you posted, then make a function that grabs each date, prints it out in date order then looks at your news table and finds all the news for that date, and posts it under neath just means when you add the news, you have to look at the date table to see if that date has already been added. Also theirs probally a easier way to do this, but since i only just got up, i cant think. Date table dateID date News table newsID dateID summary title i hope u get all that eheh |
|
#7
|
|||
|
|||
|
dateID on both tables should then do a join?
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Sort by date? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|