refactor: migrate API scripts to a centralized directory and implement shared database configuration
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
$conn = new mysqli("localhost", "root", "", "gis_project");
|
require_once __DIR__ . '/config.php';
|
||||||
|
$conn = getDB();
|
||||||
|
|
||||||
$id = $_POST['id'];
|
$id = $_POST['id'];
|
||||||
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
$conn = new mysqli("localhost", "root", "", "gis_project");
|
require_once __DIR__ . '/config.php';
|
||||||
|
$conn = getDB();
|
||||||
|
|
||||||
$result = $conn->query("SELECT * FROM worship_places");
|
$result = $conn->query("SELECT * FROM worship_places");
|
||||||
$places = [];
|
$places = [];
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
$conn = new mysqli("localhost", "root", "", "gis_project");
|
require_once __DIR__ . '/config.php';
|
||||||
|
$conn = getDB();
|
||||||
|
|
||||||
$name = $_POST['name'];
|
$name = $_POST['name'];
|
||||||
$lat = $_POST['lat'];
|
$lat = $_POST['lat'];
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
$conn = new mysqli("localhost", "root", "", "gis_project");
|
require_once __DIR__ . '/config.php';
|
||||||
|
$conn = getDB();
|
||||||
|
|
||||||
$id = $_POST['id'];
|
$id = $_POST['id'];
|
||||||
$rad = $_POST['radius'];
|
$rad = $_POST['radius'];
|
||||||
|
|
||||||
Reference in New Issue
Block a user