我有从数据库中的表打印订单的文件,但我想选择用户输入的具有相同值的行 这是我的PHP文件:
<script type="text/javascript">function printpage() { window.print()}</script>
<HTML>
<BODY>
<?php
$con=mysqli_connect("","","","");
// Check connection
if (mysqli_connect_errno())
{echo "Failed to connect to MySQL: " . mysqli_connect_error();}
$result = mysqli_query($con,"SELECT * FROM order_items");
echo "<table border='1'>
<tr>
<th>ANAME</th>
<th>ID</th>
<th>NAME</th>
<th>QUANTITY</th>
<th> PRICE</th>
<th>CUSTOMER</th>
<th>DATETIME</th>
<th>TOATAL COAST</th>
<th>TOTAL WIGHT</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['aname'] . "</td>";
echo"<td>". $row['id']."</td>";
echo"<td>". $row['name']."</td>";
echo"<td>". $row['quantity'] ."</td>";
echo"<td>". $row['price'] ."</td>";
echo"<td>". $row['customer'] ."</td>";
echo"<td>". $row['datetime'] ."</td>";
echo"<td>". $row['totalcost'] ."</td>";
echo"<td>". $row['totalweight'] ."</td>";
echo "</tr>";
}
echo "</table>";
echo "<input type=\"button\" value=\"Print this page\" onclick=\"printpage()\" />";
mysqli_close($con);
?>
现在我想只检索客户是“特定客户”打印的记录