postgresql - How to compare date and time separately in postgres with php date-time value? -
i doing work in php , postgresql zend framework.
i have date variable value of '2013-04-12'(y-m-d format) , time variable value of '13:20:00'.
my date field , time field in database table separate.
how can compare php date , time datetime in database table?
this way may select them 1 field , compare correct timestamp value.
this can used if have field types date , time!
$data = date('y-m-d h:i:s' , $time); $sql = "select * table date_field || ' ' || time_field > '{$date}'";
Comments
Post a Comment