-
Notifications
You must be signed in to change notification settings - Fork 0
/
getport.php
42 lines (35 loc) · 962 Bytes
/
getport.php
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
require_once "path.php";
require_once $path_settings."db.php";
if($_GET['tankselect']){
$q = "SELECT * FROM `port_tankselect`;";
$result = $mysql->query($q);
echo json_encode($result->fetch_assoc());
}
if($_GET['valve']){
$q = "SELECT * FROM `port_valve`;";
$result = $mysql->query($q);
echo json_encode($result->fetch_assoc());
}
if($_GET['plotnomer']){
$q = "SELECT * FROM `port_plotnomer`;";
$result = $mysql->query($q);
$json = array();
$row = $result->fetch_assoc();
while($row){
array_push($json,$row);
$row = $result->fetch_assoc();
}
echo json_encode($json);
}
if($_GET['ecu']){
$q = "SELECT * FROM `port_ecu`;";
$result = $mysql->query($q);
$json = array();
$row = $result->fetch_assoc();
while($row){
array_push($json,$row);
$row = $result->fetch_assoc();
}
echo json_encode($json);
}