We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7455
    • 2,204 Posts
    I need to get rows from my db :

    SELECT *
    FROM `stb_contracten`
    WHERE ( (`c_eind` - 267840) < NOW() )


    where c_eind is a timestamp in the future and 267840 1 month and NOW() is a timestamp from now.

    it looks like it does not work
    result is always all rows while there are only 2 or 3 that should show up somhow (`c_eind` - 267840) is not working.

    the result should be all rows that have a timstamp (c_eind) that is 2moths or less from date from today

    does any one know How I could do this without dooing double queries?


    Dimmy
      follow me on twitter: @dimmy01
      • 7455
      • 2,204 Posts
      Man i had a big error
      but then even without the error the above did not work

      this one does work:
      SELECT *
      FROM `stb_contracten`
      WHERE TIMESTAMPDIFF(SECOND,NOW(),FROM_UNIXTIME(c_eind)) <= 267840
        follow me on twitter: @dimmy01