Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2.  
  3. $route_name = $_POST['route_name'];
  4. $route_description = $_POST['route_description'];
  5.  
  6. require 'db_connect.php';
  7.  
  8. $db = new DB_CONNECT();
  9.  
  10. $result = mysql_query("INSERT INTO routes(route_name, route_description) VALUES('.$route_name.', '.$route_description.')");
  11.  
  12. if ($result) {
  13. $response["success"] = 1;
  14. $response["message"] = "Route successfully created.";
  15.  
  16. echo json_encode($response);
  17. } else {
  18. $response["success"] = 0;
  19. $response["message"] = "Oops! An error occurred.";
  20.  
  21. echo json_encode($response);
  22. }
  23.  
  24. echo json_encode($response);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement