Okay, I wonder how to get my Database Table to change at a certain time.
Example :
After 1 hour after submitting the form automaticly change to Prio 2
After 3 hours automaticly change to Prio 3
Thats what I need..
This is the code I use to read the table :
<?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);
?>
You have to run a scheduled task or cron. You have to call your script as often as you want to update the data in the tables. The script should check if the time since the creation is bigger than one-two… hours. If yes, than it should change the prio. Assuming that you are using timestamps, the code should be something like this: