first commit
This commit is contained in:
27
lookup.php
Normal file
27
lookup.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
include("functions.php");
|
||||
require_db_auth();
|
||||
|
||||
$conn = connectDb();
|
||||
|
||||
// SQL Query
|
||||
$sql = "SELECT * FROM aircraft WHERE clean_reg like '" . $_GET['reg'] . "'"; // Modify table/fields as needed
|
||||
$result = $conn->query($sql);
|
||||
|
||||
// Fetch data
|
||||
$data = [];
|
||||
if ($result->num_rows > 0) {
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$data[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
// Close connection
|
||||
$conn->close();
|
||||
|
||||
// Return JSON output
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($data, JSON_PRETTY_PRINT);
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user