Execute query after 1 hour

Attached the table sample.
enter image description here

What i am trying to achieve is on every hour it selects one media_id (id=1) and executes my code, then 2nd hour (id=2) and so on, How I can track which one to execute and whats the latest, Do I need to add a new table and save the current id or what? Really confused on this.

$check5 = "select * from media_ids";
$rs5 = mysqli_query($con,$check5);
if(mysqli_num_rows($rs5)==1)
{
$row = mysqli_fetch_assoc($rs5);
$media_id=$row['media_id'];
}

// execute query


Source: mysql

Leave a Reply