好的,我想知道如何讓我的數據庫表在某個時間發生變化。在一段時間後自動更改數據庫
實施例:提交表單後
1小時後全自動改變爲PRIO 2 3小時後全自動改變爲PRIO 3
那是什麼我需要..
這是我用來讀取表格的代碼:
<?php
include("db.php");
$result=mysql_query("SELECT * FROM lijst where archief='0' ORDER BY FIND_IN_SET(prio, '#ffaeae,#fff5ae,#ffffff')");
while($test = mysql_fetch_array($result))
{
$id = $test['ticketID'];
echo"<tr style='background:". $test['prio'].";'>";
echo"<td><font color='black'>".$test['aangemeld']."</font></td>";
echo"<td>".$test['status']."</td>";
echo"<td><font color='black'>" .$test['klant']."</font></td>";
echo"<td><font color='black'>" .$test['naam']."</font></td>";
echo"<td><font color='black'>". $test['achternaam']. "</font></td>";
echo"<td><font color='black'>". $test['telefoon']. "</font></td>";
echo"<td><font color='black'>". $test['onderwerp']. "</font></td>";
echo"<td width='300px'><font color='black'>". $test['probleem']. "</font></td>";
echo"<td><font color='black'>". $test['terugb']. "</font></td>";
echo"<td><font color='black'>". $test['Tijd']. " door : ". $test['wijziging']. "</font></td>";
echo"<td><a href ='view.php?ticketID=$id'><small class='icon pencil'></small><span>Wijzig</span></a><br /><a href ='move.php?ticketID=$id'>Afgehandeld</a></td>";
echo "</tr>";
}
mysql_close($conn);
?>
'cron jobs'會幫助你。閱讀更多[這裏](http://en.wikipedia.org/wiki/Cron)。 – Stranger