php - Using many ands in SQL -


i having problems using many , statements in where statement.

when have line of php:

$where .= " , post_date >= '$app_time'"; 

it works fine, when introducing this:

$where .= " , post_date >= '$app_time' , post_date <= '$app_timetwo'"; 

it causes display results not fit in between 2 times. $app_time , $app_timetwo _$get['']; parameter, sent url iphone app. correct format.

any reason why using 2 ands breaks it? thanks.

use "between" clause instead of using multiple "and" in second query , make sure datatype of "post_date" datetime ..


Comments