samedi 5 mars 2016

Using PHP to add extra 2 min of time to the time column before processing query and showing results

So I have a table which has the Bus name and time. My query is the following:

      $name = pg_escape_string($_POST['name']);
      SELECT dt.name as name,dt.time as time
      From busses as dt
      WHERE name='"$name"' ';

Based on this query this will list the name of the bus and time depending on what the user input is. Now in my database the first bus arrives at 11:00 am but this may have a delay of 2 minutes depending on its last journey it has taken. Would I need to create a time variable and concatenate that with the time column within my query in order for it to show an arrival time of 11:02 am




Aucun commentaire:

Enregistrer un commentaire