CIM69 - Car database
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user