Which is faster for a mysql time calculation?

Discussion in 'PHP' started by phantom, Jan 10, 2011.

  1. #1
    Which is faster for a mysql time calculation:

    Comparing a timestamp column in a mysql query

    OR

    calculating the date in a column with PHP using:

    
    $date = '129432835324'; //retrieved from databases
    $epoch = time();
    
    if($date > $epoch){
    //do stuff like delete entries in table
    }
    Code (markup):
     
    phantom, Jan 10, 2011 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    Seeing as your working with MySQL theirs no reason to be using PHP when MySQL has the functionality built in, based on that - performance wise; i'd assume it would be slightly faster.
     
    danx10, Jan 10, 2011 IP