HI,
I want to check condition, the condition is like that , first i will check the condition where the table is exist in the database or not, if not it will display the error message, and if the table is exist it will display the content of the table on the page so for that i have created the script but its not working for me. its gives me me a error.
Parse error: syntax error, unexpected '>' in /var/www/html/Project/demo.php on line 62
NOTE => The created the text box on the page. and in this box user have to enter the date.
<?php
date_default_timezone_set('Asia/Calcutta');
$date=date("m/d/Y");
echo "Today Date Is = ";
echo "$date";
$con = mysql_connect("localhost","root","access");
if(!$con)
{
die("Unable Connect To Database Server " .mysql_error());
}
$selectdb=mysql_select_db("sample",$con);
if(!$selectdb)
{
die ("Database Connection Error" .mysql_error());
}
$table="sample";
if(isset($_POST['submit']))
{
$check = "SELECT * FROM $table where DATE='{$_POST["search"]}'";";
$fetch=mysql_query($check,$con);
if(!$fetch)
{
echo "<br>";
echo "No table Found In The Database";
echo "<br>";
}
else
{
$sql= "select DATE,JOBNAME,TIME,INITIALS,TIMESTAMP from $table where DATE='{$_POST["search"]}'";
$mydata=mysql_query($sql,$con);
echo "<table width=100% height=10% border=1>
<tr>
<th>DATE</th>
<th>JOBNAME</th>
<th>TIME</th>
<th>INITIALS</th>
<th>System TIMESTAMP</th>
</tr>";
while($records = mysql_fetch_array($mydata))
{
echo "<tr>";
echo "<td>" . $records['DATE'] . " </td>";
echo "<td>" . $records['JOBNAME']. " </td>";
echo "<td>" . $records['TIME'] . " </td>";
echo "<td>" . $records['INITIALS'] . " </td>";
echo "<td>" . $records['TIMESTAMP'] . " </td>";
}
echo "<br>";
}
echo "</table>";
}
?>



