Jump to content

Why my table data is not display


Ashish Sood

Recommended Posts

if(isset($_POST['submit'])){	 $selectcondition = "SELECT * FROM turnovers where INCIDENTID='".$_POST['search']."'"; //Select Query Which check the date whether the checklist for the given date is exit or not.	 $check=mysql_query($selectcondition,$con);	 $fetch=mysql_fetch_assoc($check);	 $status = mysql_query("SELECT STATUS FROM turnovers where INCIDENTID='".$_POST['search']."'");	 $fetch_status=mysql_fetch_assoc($status);	  	if(!$fetch) //If checklist for the given date is not exit execute if condition{			    echo '<font color="red">';  echo "<br>";  echo "No Incident Found In The Database";  echo "<br>";			    echo "</font>";}if ($fetch_status['STATUS'] =="closed"){  echo "<table width='100%' height='10%' border='1' cellspacing='0'>			     <tr bgcolor='#3399FF'>				   <th>DATE</th>				   <th>CITY</th>				   <th>SAMPLE</th>				   <th>NAME</th>								 </tr>";  while($records = mysql_fetch_array($status))		   {  			  echo "<tr bgcolor='#009999'>";			  echo "<td>" . $records['DATE'] . " </td>";			  echo "<td>" . $records['CITY']. " </td>";			  echo "<td>" . $records['SAMPLE'] . " </td>";			  echo "<td>" . $records['NAME'] . " </td>";      } 				  echo "</table>";}   

The First if block is executed successfully but my second if block is half executed mean only the table heading is printed on the form but the table not data. please let me know what wrong in my second if block.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...