saveNote.php 513 B

12345678910111213141516
  1. <?php
  2. include 'db.php';
  3. $lng = pg_escape_string($_POST['lng']);
  4. $lat = pg_escape_string($_POST['lat']);
  5. $name = pg_escape_string($_POST['name']);
  6. $note = pg_escape_string($_POST['note']);
  7. $date = pg_escape_string($_POST['date']);
  8. $type = pg_escape_string($_POST['type']);
  9. $point = "POINT $lng $lat";
  10. $sql = "INSERT INTO hicheck.notes (hi_user_id, geom, note, date, type)
  11. VALUES ('$name', ST_SetSRID(ST_MakePoint($lng,$lat), 4326),'$note', '$date', '$type')";
  12. pg_query($db, $sql);
  13. exit(pg_last_error($db));