Note that there are some explanatory texts on larger screens.

plurals
  1. POis there anything wrong on my code?
    primarykey
    data
    text
    <p>i am trying to display the leave history of a particular employee,but when i choose a particular month,for example:i choose january to display,instead of displaying the history of january,it displaying all the history from this year..is there anything wrong with my codes?below here is my codes:</p> <pre><code>&lt;?php echo 'View the application history by :&lt;select name="date"&gt; &lt;option value="january" selected="selected"&gt;January&lt;/option&gt; &lt;option value="february" &gt;February&lt;/option&gt; &lt;option value="march"&gt;March&lt;/option&gt; &lt;option value="april"&gt;April&lt;/option&gt; &lt;option value="may"&gt;May&lt;/option&gt; &lt;option value="june"&gt;June&lt;/option&gt; &lt;option value="july"&gt;July&lt;/option&gt; &lt;option value="august"&gt;August&lt;/option&gt; &lt;option value="september"&gt;September&lt;/option&gt; &lt;option value="october"&gt;October&lt;/option&gt; &lt;option value="november"&gt;November&lt;/option&gt; &lt;option value="december"&gt;December&lt;/option&gt;'; echo'&lt;/select&gt;'; $value = 'value'; if($value=='january') { $check_user=mysql_query("select*from employee e, `leave` l where e.emp_id = l.emp_id and l.Emp_ID='".$aid."' and Date_Apply &gt;='2013-01-01' and Date_Apply&lt;'2013-01-31'"); } else if($value=='february') { $check_user=mysql_query("select*from employee e, `leave` l where e.emp_id = l.emp_id and l.Emp_ID='".$aid."' and Date_Apply &gt;='2013-02-01' and Date_Apply&lt;'2013-02-28'"); } else if($value=='march') { $check_user=mysql_query("select*from employee e, `leave` l where e.emp_id = l.emp_id and l.Emp_ID='".$aid."' and Date_Apply &gt;='2013-03-01' and Date_Apply&lt;'2013-03-31'"); } else if($value=='april') { $check_user=mysql_query("select*from employee e, `leave` l where e.emp_id = l.emp_id and l.Emp_ID='".$aid."' and Date_Apply &gt;='2013-04-01' and Date_Apply&lt;'2013-04-30'"); } else if($value=='may') { $check_user=mysql_query("select*from employee e, `leave` l where e.emp_id = l.emp_id and l.Emp_ID='".$aid."' and Date_Apply &gt;='2013-05-01' and Date_Apply&lt;'2013-05-31'"); } else if($value=='june') { $check_user=mysql_query("select*from employee e, `leave` l where e.emp_id = l.emp_id and l.Emp_ID='".$aid."' and Date_Apply &gt;='2013-06-01' and Date_Apply&lt;'2013-06-30'"); } else if($value=='july') { $check_user=mysql_query("select*from employee e, `leave` l where e.emp_id = l.emp_id and l.Emp_ID='".$aid."' and Date_Apply &gt;='2013-07-01' and Date_Apply&lt;'2013-07-31'"); } else if($value=='august') { $check_user=mysql_query("select*from employee e, `leave` l where e.emp_id = l.emp_id and l.Emp_ID='".$aid."' and Date_Apply &gt;='2013-08-01' and Date_Apply&lt;'2013-08-31'"); } else if($value=='september') { $check_user=mysql_query("select*from employee e, `leave` l where e.emp_id = l.emp_id and l.Emp_ID='".$aid."' and Date_Apply &gt;='2013-09-01' and Date_Apply&lt;'2013-09-30'"); } else if($value=='october') { $check_user=mysql_query("select*from employee e, `leave` l where e.emp_id = l.emp_id and l.Emp_ID='".$aid."' and Date_Apply &gt;='2013-10-01' and Date_Apply&lt;'2013-10-31'"); } else if($value=='november') { $check_user=mysql_query("select*from employee e, `leave` l where e.emp_id = l.emp_id and l.Emp_ID='".$aid."' and Date_Apply &gt;='2013-11-01' and Date_Apply&lt;'2013-11-30'"); } else if($value=='december') { $check_user=mysql_query("select*from employee e, `leave` l where e.emp_id = l.emp_id and l.Emp_ID='".$aid."' and Date_Apply &gt;='2013-12-01' and Date_Apply&lt;'2013-12-31'"); } echo "&lt;table border='1'&gt;"; echo "&lt;tr&gt;"; echo "&lt;th&gt;Leave No&lt;/th&gt;"; echo "&lt;th&gt;Leave Start&lt;/th&gt;"; echo "&lt;th&gt;Leave End&lt;/th&gt;"; echo "&lt;th&gt;Date Apply&lt;/th&gt;"; echo "&lt;th&gt;Duration&lt;/th&gt;"; echo "&lt;th&gt;Leave Type&lt;/th&gt;"; echo "&lt;th&gt;Leave Reason&lt;/th&gt;"; echo "&lt;th&gt;Status&lt;/th&gt;"; $counter = 0; while($rows = mysql_fetch_assoc($check_user)) { echo"&lt;tr&gt;"; echo"&lt;td&gt;" . $rows['Leave_ID'] . "&lt;/td&gt;"; echo"&lt;td&gt;" . $rows['Leave_Start'] . "&lt;/td&gt;"; echo"&lt;td&gt;" . $rows['Leave_End'] . "&lt;/td&gt;"; echo"&lt;td&gt;" . $rows['Date_Apply'] . "&lt;/td&gt;"; echo"&lt;td&gt;" . $rows['Duration'] . "&lt;/td&gt;"; echo"&lt;td&gt;" . $rows['Leave_Type'] . "&lt;/td&gt;"; echo"&lt;td&gt;" . $rows['Leave_Reason'] . "&lt;/td&gt;"; echo"&lt;td&gt;" . $rows['Status'] . "&lt;/td&gt;"; $counter++; } echo "&lt;/table&gt;"; ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload