putting if and else to my php query
<pre><code>&lt;?
require_once('../Connections/biometrics_conn.php'); 
mysql_select_db($database_biometrics_conn, $biometrics_conn);
if($query_hrAdmin = "SELECT * FROM leave_form_bal_copy where  final_approval not in( 'x','-',' ')"){
}
else {
$query_hrAdmin = "delete from leave_form_bal_copy where rid ='$rid'";
}
$hrAdmin = mysql_query($query_hrAdmin, $biometrics_conn) or die(mysql_error());
$row_hrAdmin = mysql_fetch_assoc($hrAdmin);
?&gt;


&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;link href="../css/leavereportstyle.css" rel="stylesheet" type="text/css" /&gt;
&lt;link href="../css/aqua/images/style.css" rel="stylesheet" type="text/css" /&gt;
&lt;link href="../css/newfangled/default.css" rel="stylesheet" type="text/css" /&gt;
&lt;/head&gt;

&lt;body&gt;
 &lt;form action="" method="post"&gt;
 &lt;table cellspacing="5"&gt;
      &lt;tr &gt;
        &lt;td&gt;Form No.&lt;/td&gt;
        &lt;td&gt;Name&lt;/td&gt;
        &lt;td&gt;Type of Leave&lt;/td&gt;
        &lt;td&gt;Date Filled&lt;/td&gt;
        &lt;td&gt;Department&lt;/td&gt;
        &lt;td&gt;Start Date&lt;/td&gt;
        &lt;td&gt;End Date&lt;/td&gt;
        &lt;td&gt;No of Days/Hours&lt;/td&gt;
        &lt;td&gt;Reject&lt;/td&gt;
      &lt;/tr&gt;
      &lt;?php do { ?&gt;
      &lt;tr onmouseover="this.bgColor = '#FFFFCC'" onmouseout="this.bgColor='#FFFFFF'"&gt;
        &lt;td &gt;&lt;a href="show_temp_leave_app.php?leave=&lt;?php echo $row_hrAdmin['rid']; ?&gt;"&gt;
          &lt;input name="button" type="button" class="link_button" style="width:70px; height:25px;" id="button" value="&lt;?php echo $row_hrAdmin['rid']; ?&gt;" /&gt; 
        &lt;/a&gt;&lt;/td&gt;
        &lt;td  &gt;&lt;?php echo $row_hrAdmin['name_of_employee']; ?&gt;&lt;/td&gt;
        &lt;td  &gt;&lt;?php echo $row_hrAdmin['type_of_leave']; ?&gt;&lt;/td&gt;
        &lt;td &gt;&lt;?php echo $row_hrAdmin['date_filled']; ?&gt;&lt;/td&gt;
        &lt;td &gt;&lt;?php echo $row_hrAdmin['dept_code']; ?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?php echo $row_hrAdmin['start_date']; ?&gt;&lt;/td&gt;
        &lt;td &gt;&lt;?php echo $row_hrAdmin['end_date']; ?&gt;&lt;/td&gt;
        &lt;td &gt;&lt;?php echo $row_hrAdmin['no_of_days_time']; ?&gt;&lt;/td&gt;
       &lt;td &gt;&lt;input name="delete" type="button" id="delete" value="&lt;?php echo $row_hrAdmin['rid']; ?&gt;" /&gt; 
        &lt;/td&gt;

      &lt;/tr&gt;
      &lt;tr onmouseover="this.bgColor = '#FFFFCC'" onmouseout="this.bgColor='#FFFFFF'"&gt;
        &lt;td &gt;&amp;nbsp;&lt;/td&gt;
        &lt;td  &gt;&amp;nbsp;&lt;/td&gt;
        &lt;td  &gt;&amp;nbsp;&lt;/td&gt;
        &lt;td &gt;&amp;nbsp;&lt;/td&gt;
        &lt;td &gt;&amp;nbsp;&lt;/td&gt;
        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
        &lt;td &gt;&amp;nbsp;&lt;/td&gt;
        &lt;td &gt;&amp;nbsp;&lt;/td&gt;
        &lt;td &gt;&amp;nbsp;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;?php } while ($row_hrAdmin = mysql_fetch_assoc($hrAdmin));?&gt;


    &lt;/table&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>//About the code above im trying to work the delete button just using if statement on my php query... i know i have wrong declaration on my button .. i dont know but please help to fix my code.. thank you**</p>
