Question
Please help me I want to search the data of employee by month like january, february etc. by drop down list and the date field
Please help me I want to search the data of employee by month like january, february etc. by drop down list and the date field is date type 0000-00-00.How can I search this type of data in php thank you. This is my code
$param_data = array(); $comb1 = ""; $tar = date('Y-m-d'); $month = (isset($_GET['month'])) ? $_GET['month'] : '' ; $year = (isset($_GET['year'])) ? $_GET['year'] : '' ;
if($year==""){ $year=date("Y"); }
?>
if(!empty($month)){ $comb1 .= " AND a.month LIKE ? "; $param_data['month'] = "%{$month}%"; } // if(!empty($year)){ $comb1 .= " AND a.year LIKE ? "; $param_data['year'] = "%{$year}%"; }
$sql = "SELECT a.* FROM staff a WHERE 1 {$comb1}"; $data = mysqli_prepare_all($sql,$param_type = "auto",$param_data); while($rowKod = $data->fetch_assoc()){
$editdata = "val-id#{$rowKod['id']}|" ."val-dateStart#{$rowKod['dateStart']}|" ."val-dateEnd#{$rowKod['dateEnd']}|" ."val-name#{$rowKod['name']}|";
?>
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started