我的PHP代码在下面给出....
我运行此文件超出错误...为什么会出现此错误。请帮帮我......
在此代码中出错...请帮助...我已将其更改为..
<html>
<head>
<title>MySQLi Read Records</title>
</head>
<body>
<?php $mysqli=n ew mysqli( 'localhost', 'root', '', 'employe'); //Output any connection error if ($mysqli->connect_error) { die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error); }else{ echo"connection good"; } //query all records from the database $sql = "SELECT id,employe_name,gender,jdate FROM employe_detail"; $result=$mysqli->query($sql);
echo "
<div><a href='add.php'>Create New Record</a>
</div>"; if($result->num_rows>0){ //get number of rows returned echo"
<table border='2'>"; echo"
<tr>"; echo"
<th>ID</th>"; echo"
<th>Employe Name</th>"; echo"
<th>Employe Gender</th>"; echo"
<th>Employe Joining Date</th>"; echo"
</tr>"; while($row = $result->fetch_assoc()){ echo"
<tr>"; echo "
<td>" .$row['id']."</td>"; echo "
<td>".$row['employe_name']."</td>"; echo "
<td>" .$row['gender']."</td>"; echo "
<td>" .$row['jdate']."</td>"; echo "
<td>" <a href="edit.php?id={'.$row[" id "].'} ">Edit</a>"</td>"; echo"
</tr>"; } } else{ //if database table is empty echo "No records found."; } //disconnect from database $mysqli->close(); ?>
</body>
</html>