PHP, MySQL - how to parameterize timestamp comparisons -
i have $year , $month, , need select records timestamp after 1 year/month , before year/month
where m.id = :magazineid , t.ischargedback false , t.`timestamp` >= str_to_date(:year'-08-01', '%y-%m-%d') , t.`timestamp` < str_to_date('2013-09-01', '%y-%m-%d')
just started sub'd out 1 of year entries , query stopped finding rows.
how 1 supposed parameterize this?
did try using:
`t`.`timestamp` between "$date1" , "$date2"?
you might want try instead of using str_to_date, converting date timestamp
Comments
Post a Comment