请有人告诉我我错在哪里?运行脚本时出现以下错误:
解析错误:语法错误,第 32 行 C:\wamp\www\baljeet2\ViewAllPolicy1.php 中的意外 T_VARIABLE
这是我的完整代码:
<!DOCTYPE html>
<html>
<body bgcolor='white'>
<?PHP
include 'config.php';
session_start();
//if ($_SESSION['auth']!='TRUE') {
//header ("Location: ../a_login.php");
//}
?>
<?PHP
$con=mysqli_connect($host,$user,$pass,$DB_name);
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
else
{
echo "";
}
$result = mysqli_query($con,"SELECT * FROM policydetail1");
echo "pass<br>";
int $num_rows=0;
$num_rows= mysql_num_rows($result);
if ($num==0) {
// Show message
echo "No record Found";
} else {
// do your while stuff here
while($row = mysqli_fetch_array($result))
{
echo $row['CompanyName']." ".$row['PolicyNo']." ".$row['OD']." ".$row['ThirdParty']." ".$row['ServiceTaxRate']." ".$row['TotalAmount']." ".$row['Discount']." ".$row['CommissionRate']." ".$row['Commission']." ".$row['CommissionStatus']." ".$row['Date']."<br>";
}
}
mysqli_close($con);
//echo "<div align='center'><div style='background-color:#4682B4; color:white; width:1000px; height:30px; text-align:center; font-family:trebuchet ms;'>Policy Add Succefully!!!</div></div><br> <div align='center'><a href='Add Policy Form.html'>Add more records</a><a href='Add Policy Form.html'> <BR>Back to Main Menu</a></div>";
?>
我是 PHP 新手,很难找到这个错误。第 32 行的代码如下:
int $num_rows=0; //Here I am getting error
我还检查了分号和语法,但没有找到。