Ashish Sood Posted February 23, 2013 Share Posted February 23, 2013 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 More sharing options...
Don E Posted February 23, 2013 Share Posted February 23, 2013 May or may not be the issue but it looks like you're missing a closing brace } for either the first if statement block:if(isset($_POST['submit'])) or this one: if ($fetch_status['STATUS'] =="closed"). Link to comment Share on other sites More sharing options...
Ashish Sood Posted February 23, 2013 Author Share Posted February 23, 2013 I closed the isset function braces is not the issues , Because page is loaded without any problem but field data is not retrieved. Link to comment Share on other sites More sharing options...
dsonesuk Posted February 23, 2013 Share Posted February 23, 2013 you have only chosen the status field to show"SELECT STATUS FROM turnovers where INCIDENTID='".$_POST['search']."'"if you want the rest you will have to list them as well or use 'SELECT *' as in all. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now