SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: Simple Blog

Hybrid View

  1. #1
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Simple Blog

    Hey guys,

    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.

    Thanks

    Silversurfer
    "Persistence is the path to perfection"

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    If you're storing the date the post was created (created_on, for example), it's pretty trivial.
    Code:
    SELECT id, title, content FROM post ORDER BY created_on DESC;
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Anthony,

    Thats working great
    "Persistence is the path to perfection"

  4. #4
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    669
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi silv

    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
    I'll do anything to avoid working on my own code

    Are you using: if (isset($_POST['submit'])) ?
    IE has a bug and does not always send the value.

  5. #5
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey thanks Tango I will check it out. Hope ur doing ok. Finshed that CMS mod finally, hows things?
    "Persistence is the path to perfection"

  6. #6
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    669
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lol, my CMS? Never finished lol. Yeah apart from that i'm good
    I'll do anything to avoid working on my own code

    Are you using: if (isset($_POST['submit'])) ?
    IE has a bug and does not always send the value.

  7. #7
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    "Persistence is the path to perfection"

  8. #8
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    669
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure thing.
    I'll do anything to avoid working on my own code

    Are you using: if (isset($_POST['submit'])) ?
    IE has a bug and does not always send the value.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •