Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

ISBN: 1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

What factors characterize emotions?

Answered: 1 week ago

Question

Critically discuss "the Agency Problem"

Answered: 1 week ago

Question

To solve p + 3q = 5z + tan( y - 3x)

Answered: 1 week ago

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago