在php中运行此分页页面演示时出错?
在php中运行此分页页面演示时出错?,php,html,mysql,pagination,Php,Html,Mysql,Pagination,限制后需要一个空格 $limit = 'LIMIT'.($pn-1)*$itemPerPage.','.$itemPerPage; 看起来您需要在LIMIT $limit = 'LIMIT'.($pn-1)*$itemPerPage.','.$itemPerPage; $sql2 = mysql_query("SELECT * FROM emp ORDER BY emp_id $limit"); $outputList = ''; while($row = mysql_f
限制后需要一个空格
$limit = 'LIMIT'.($pn-1)*$itemPerPage.','.$itemPerPage;
看起来您需要在
LIMIT
$limit = 'LIMIT'.($pn-1)*$itemPerPage.','.$itemPerPage;
$sql2 = mysql_query("SELECT * FROM emp ORDER BY emp_id $limit");
$outputList = '';
while($row = mysql_fetch_array($sql2)){
$id = $row["emp_id"];
$fname = $row["emp_fname"];
$lname = $row["emp_lname"];
$email = $row["emp_email"];
$desc = $row["emp_desc"];
$outputList = '
<tr>
<td>'.$id.'</td>
<td>'.$fname.'</td>
<td>'.$lname.'</td>
<td>'.$email.'</td>
<td>'.$desc.'</td>
<td>
<a href="view.php?id='.$id.'" title="View details..."><img src="assets/img/view.png" alt="View" /></a> | <a href="edit.php?id='.$id.'" title="Edit details..."><img src="assets/img/edit.png" alt="Edit" /></a> | <a href="delete.php?id='.$id.'" title="Delete details..."><img src="assets/img/delete.png" alt="Delete" /></a></td>
</tr>
';
}
?>
<html>
<head>
<title>
Employee dashboards!!!!
</title>
<style type="text/css">
.pagNumActive {
color: #000;
border:#060 1px solid; background-color: #D2FFD2; padding-left:3px; padding-right:3px;
}
.paginationNumbers a:link {
color: #000;
text-decoration: none;
border:#999 1px solid; background-color:#F0F0F0; padding-left:3px; padding-right:3px;
}
.paginationNumbers a:visited {
color: #000;
text-decoration: none;
border:#999 1px solid; background-color:#F0F0F0; padding-left:3px; padding-right:3px;
}
.paginationNumbers a:hover {
color: #000;
text-decoration: none;
border:#060 1px solid; background-color: #D2FFD2; padding-left:3px; padding-right:3px;
}
.paginationNumbers a:active {
color: #000;
text-decoration: none;
border:#999 1px solid; background-color:#F0F0F0; padding-left:3px; padding-right:3px;
}
</style>
</head>
<body>
<center>
<?php echo $paginationDisplay; ?>
</center>
<table cellpadding="5" cellspacing="4" border="4" width="100%" >
<thead>
<tr>
<th>Employee ID</th>
<th>Employee First Name</th>
<th>Employee Last Name</th>
<th>Employee Email ID</th>
<th>Employee Bio</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php echo $outputList; ?>
</tbody>
</table>
<center>
<?php echo $paginationDisplay; ?>
</center>
</body>
</html>
$limit = 'LIMIT'.($pn-1)*$itemPerPage.','.$itemPerPage;
$limit = 'LIMIT '.($pn-1)*$itemPerPage.','.$itemPerPage;