forked from GlidingWeb/IGCWebView
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfindtp.php
More file actions
25 lines (25 loc) · 678 Bytes
/
findtp.php
File metadata and controls
25 lines (25 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
require_once("../db_inc.php");
$mysqli=new mysqli($dbserver,$username,$password,$database);
$postdata=strtoupper($_POST['postdata']);
if(strlen($postdata)==3) {
$stmt = $mysqli->prepare("SELECT * FROM tpoints WHERE trigraph=?");
}
else {
$stmt = $mysqli->prepare("SELECT * FROM worldpoints WHERE hexagraph=?");
}
$stmt->bind_param("s", $postdata);
$stmt->execute();
$response=$stmt->get_result();
if($response->num_rows > 0) {
$result= $response->fetch_assoc();
}
else {
$result['tpname']= "Not found";
$result['latitude']="";
$result['longitude']="";
}
$stmt->close();
$mysqli->close();
echo json_encode($result,JSON_NUMERIC_CHECK);
?>