I'm new php programmer anyone can help to resolve my problem.. this is my dropdown list: <select> <option value="">--- Select Date Range ---</option> <option value="Today">Today</option> <option value="ThisWeek">This Week</option> <option value="LastWeek">Last Week</option> </select> i want to create the if else statement where when user select the value "Today" the query result will display only the today data from tables. this is my simple code,but still cannot display the result: if($dateRangeSel=='Today') { $todayDate = date('Y-m-d'); if($sqlw!=' WHERE ') $sqlw.=' AND '; $sqlw.='date(date_posted)="'.$todayDate.'"'; } else if($dateRangeSel=='ThisWeek') { $startDate=''; $endDate=''; getWeekRange($startDate, $endDate,0); $startDate.=" 00:00:00"; $endDate.=" 23:59:59"; if($sqlw!=' WHERE ') $sqlw.=' AND '; $sqlw.='date_posted>="'.$startDate.'"'; if($sqlw!=' WHERE ') $sqlw.=' AND '; $sqlw.='date_posted<="'.$endDate.'"'; } Regards, Azri