CIM69 - Car database

This commit is contained in:
“VeLiTi”
2024-04-23 17:09:31 +02:00
parent 5f89767faf
commit 0b4ba34ea5
12 changed files with 604 additions and 10 deletions

View File

@@ -324,5 +324,23 @@ case 'getfirmwareCommunication':
break;
case 'getCartest':
//FILTER FOR GROUPBY FILTERS on CAR
$filter1 = '"CarBrand": "';
$filter2 = '"CarType": "';
$filter3 = '"CarVIN": "';
//CONNECT TO DB
$pdo = dbConnect($dbname);
$sql = "SELECT * from history where type='cartest' group by SUBSTRING_INDEX(SUBSTRING_INDEX(description, '$filter1', -1),'$filter2',1), SUBSTRING_INDEX(SUBSTRING_INDEX(description, '$filter2', -1),'$filter3',1) ORDER BY description ASC";
$stmt = $pdo->prepare($sql);
$stmt->execute();
//Get results
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo json_encode($result,JSON_UNESCAPED_UNICODE);
break;
}
// end switch