How to convert a reminder app in JS to PHP/mysqli

How to convert a reminder app in JS to PHP/mysqli

I wanted to make a basic prototype reminder app and so i first built it in javascript , so i plain JS i am just basically accepting time from the user and then some Math calculation to return the difference in seconds and then i use a setTimeout like so:

  1. setTimeout(function(){
  2.     // Remind the user of a task.
  3. }, /* difference in secounds from current time to what the user has entered */)

The above is basically a oversimplified version of my JS application , but now suppose i have to write the same in PHP , how would this work , i mean ofcoure i will take the time and store it in the database , but then how exactly would a reminder app work in PHP/MySqli ??

This my be a very broad question, but i just can't think of anything right now and so i taught it would be best to post and get an opinion .

Thank you.
Gautam.