Add and Remove operations for between stops
[bus.git] / betweenpoint.delete.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
  
  $conn = pg_connect("dbname=bus user=postgres password=snmc");
  if (!$conn) {
      echo "An error occured.\n";
      exit;
  }
  if ($_REQUEST['oldgeopo']) {
    
      $sql = " DELETE from stops WHERE geohash = '{$_REQUEST['oldgeopo']}'";
      $result = pg_query($conn, $sql);
      if (!$result) {
          echo("Error in SQL query: " . pg_last_error() . "<br>\n");
      } else {
      echo "Deleted {$_REQUEST['oldgeopo']}<br>";
      }
  }
  flush();
?>