Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

  1.  permalink
    Hey guys this is my first of many post over here. in joining i feel that i should offer some help, so when i need help you may be more atp to lend and ear ; )

    anyway i started slim a little while ago to help us noobs in php and it is going well, please take a look and feel free to share your thoughts and opinions about the topics you see there. slim
    •  
      CommentAuthornifkin
    • CommentTimeJan 12th 2006
     permalink
    looks like some helpful stuff to me. one question regarding your RSS feed post though.

    $query = mysql_query("SELECT id, title, date, body FROM $tableName ORDER BY id DESC");

    that will sort your posts by ID which isn't necessarilly going to mean "chronological order", shouldn't it ORDER BY date DESC instead (which should sort them from newest to oldest)?
    •  
      CommentAuthortsk
    • CommentTimeJan 12th 2006
     permalink
    yet here you have another dilema.
    If for example your entry uses datetime, everytime that post is modified it will change its value so use datetime carefuly and do not rely on it for sorting.

    I do believe that sorting by id is a correct way of sorting chronologicaly, if the id field is an auto_increment INT.
    Do you have an example of situations it may not work correcyly?
    •  
      CommentAuthornifkin
    • CommentTimeJan 12th 2006
     permalink
    if you enter items into a database for future release (wordpress lets you do this, ekwipment does as well) then the IDs and dates are not in the same sequence.
    •  
      CommentAuthortsk
    • CommentTimeJan 13th 2006
     permalink
    that's a good point. I haven't looked at it that way before, probably because I didn't use the concept of 'future release'.
  2.  permalink
    Hey guys, sry i took me so long to get back here. you both bring up valid points. Nifkin, I did the sort by id, because the id is auto incremented , so basically the newest entry is the latest insert. even if you delete one out of order it will still put them in order from the latest entry to the oldest one, becasue of the ORDER BY. if there was no order by then you would have trouble. because if you deleted one being that sql will fill any holes with an insert they would be out of order. but as long as no ids are changed or rather a new entry gets asigned a deleted id ( which can't happen ) then we are ok with that order.

    fyi: this is not a WP or TP set up, I hand wrote ( or researched and modified) all the code, from the cms that i use to enter the tuts to the comments and how they are stored. thats going to be comming soon also-creating comments tutorial.
    •  
      CommentAuthornifkin
    • CommentTimeJan 17th 2006
     permalink
    fyi: this is not a WP or TP set up

    I never said it was. I'm just throwing it out there because the way I understand the ground rules of database development is that an ID is a computer-centric way to identify something. It's not something that normally carries this sorting information in it by default unless you want to know "what order were entries added to a table in".

    All I'm trying to say is that it's like putting folders in a drawer labeled only by number on the assumption that you'll never need to sort them by the date they were put in there, the day that folder needs to be looked at again, or what the name of the project the folder was for again.
  3.  permalink
    @nifkin - nice avatar ;)

    I think the only way this comes into play is if you are dealing with future dating. which makes your point a valid. and as such any developer ( budding thought I may be :) ) worth their salt will have more than one way to sort any table of information. so to answer your question, the table does have a date associated with it as you can see just under the title on the tutorial page. If you like in the RSS reader you can change ORDER BY 'id' to ORDER BY 'date'

    you can also change that to anything you want that is associated with that table. for example if you wanted to sort by the title you could use ORDER BY 'title'
  4.  permalink
    RSS feed aggregator
    What good is a rss feed creator if you don't have a nice aggregator to go along with it? Well, here ya' go! While hanging out at my favorite forum, I happened across a thread about creating a feed aggregator and took to the challenge. Unfortunately I bite off a bit more than I could chew due unforeseen complexities of pulling in a xml feed and began searching for an easily implemented solution.
  5.  permalink
    Dynamic thumbnail creation

    While reading over the comments about HoverBox on Sonspring I figured I would have a go fulfilling some of the responses. Make sure you have read that tutorial first and understand what's going on there. One response was what would happen to the layout if the images had different orientations.[...]
Add your comments
    Username Password
  • Format comments as (Help)