silversurfer5150 — 2011-05-27T06:02:10-04:00 — #1
I am currently creating a simple PHP, MYSQL based blog so that I can supply my clients with a back-end news update page. I am aware of Blogger and other such services and it is because I am fed up of customising stylesheets on them that I am doing my own.
Anyway all working great, can add, delete and edit existing posts but I also want to list the posts on the page in the correct order by date. How is this typically done?
Is there a way of doing it with MYSQL or is it done with PHP ?
I am one of these lazy developers who tends to just use SELECT, INSERT INTO and DELETE with not much else I am afraid.
Guess it's because as I have never had the need to make sophisticated SQL commands.
Anyway your advice would be much appreciated.
anthonysterling — 2011-05-27T06:14:05-04:00 — #2
If you're storing the date the post was created (created_on, for example), it's pretty trivial.
SELECT id, title, content FROM post ORDER BY created_on DESC;
silversurfer5150 — 2011-05-27T06:20:56-04:00 — #3
Thats working great
tangoforce — 2011-05-27T06:52:39-04:00 — #4
Not sure if you're aware of it but you might want to look at ckeditor too for your news editor to create and edit articles. Very good piece of kit and your clients will love you for it
silversurfer5150 — 2011-05-27T07:33:41-04:00 — #5
Hey thanks Tango I will check it out. Hope ur doing ok. Finshed that CMS mod finally, hows things?
tangoforce — 2011-05-27T07:44:23-04:00 — #6
Lol, my CMS? Never finished lol. Yeah apart from that i'm good
silversurfer5150 — 2011-05-27T08:33:46-04:00 — #7
Cool, glad to hear it, have been exploring php bigtime lately, its a very elegant language, have a few things I'd like to ask you about your way of doing, will drop you a pm.;)
tangoforce — 2011-05-27T11:50:03-04:00 — #8