我涉猎php,我正在为我们的办公室做一些显示屏。主要是SQL(一些MSSQL和现在的DB2)选项,这些选项在40英寸显示器上进行格式化和显示。
我确实有问题,因此问题是:)
我可以在屏幕上轻松显示50条记录。不幸的是,记录在白天可以从1到300不等(订单/运输数据)。 我正在寻找一种动态的方式来显示前50个记录30秒,然后是接下来的50个30秒等等......然后在循环结束时刷新页面以拉出新的数据集并从1开始。
我拥有的基本脚本(未格式化)如下:
<!DOCTYPE html>
<html>
<head>
<meta content="en" http-equiv="Content-Language">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Shipping</title>
<style type="text/css">
.auto-style1 {
border-left: 1px solid #C0C0C0;
border-right-style: solid;
border-right-width: 1px;
border-top: 1px solid #C0C0C0;
border-bottom-style: solid;
border-bottom-width: 1px;
text-align: center;
}
.auto-style2 {
border-left-style: solid;
border-left-width: 1px;
border-right: 1px solid #C0C0C0;
border-top-style: solid;
border-top-width: 1px;
border-bottom: 1px solid #C0C0C0;
text-align: center;
}
</style>
</head>
<?php
$server="Driver={Client Access ODBC Driver (32-bit)};System=server";
$user="username"; #a valid username that will connect to the DB
$pass="password"; #a password for the username
$conn=odbc_connect($server,$user,$pass); #you may have to remove quotes
#Check Connection
if ($conn == false) {
echo "Not able to connect to database...<br>";
}
#Query the Database into a result set -
$result=odbc_exec($conn,"
select * from table");
if (!$result)
{exit("Error in SQL");}
echo "<table class='auto-style2' style='width: 800px'><tr><td class='auto-style1'>Shipment Number</td><td class='auto-style1'>Shipment Date</td><td class='auto-style1'>End customer order number</td><td class='auto-style1'>Qty</td></tr>";
while (odbc_fetch_row($result))
{
$b=odbc_result($result,1);
$c=odbc_result($result,2);
$d=odbc_result($result,3);
$e=odbc_result($result,4);
echo " <tr><td class='auto-style1'>$b</td>";
echo " <td class='auto-style1'>$c</td>";
echo " <td class='auto-style1'>$d</td>";
echo " <td class='auto-style1'>$e</td></tr>";
}
echo "</table>";
#close the connection
odbc_close($conn);
?>
非常感谢任何帮助。