Alternate method to use mysql date_sub(now(),interval 1 day) in php?
Actually I want this alternative because in zend where clause second parameter is date_sub function and it is taking it as string. Below shows exact query
->where("FROM_UNIXTIME(qnas.cdate,'%Y-%m-%d %h:%i:%s')>?" ,"date_sub(now(),interval 1 day)");
second parameter date_sub(now(),interval 1 day) is mysql function to show record greater than previous day date.
If the value is not a user supplied parameter, there’s no point in trying to bind it like one. Just write it into the query. Also, if your
cdatecolumn is any sort of date/time column, you don’t need theFROM_UNIXTIMEconversion.