Hi guys,
I have a database table that has in almost all of the vehicles ever made from 2016 until 1960s. Thats over 63000 records.
For example: I have fields like
I want to write a query that will return the vehicle make only once and to ignore any other the vehicle make if it is found again.
example
Audi
Abarth
Suzuki
Toyota
etc
Then once I have those names, I want to use them as a filter. Whenever a user selects a vehicle make, I want to search the database table and return all of its models once
example
Make: Suzuki
Model
Swift
Vitara
Jimny
etc
Here is what I have
$sql = "SELECT model_make_id FROM modx_02_models";
foreach ($modx->query($sql) as $row) {
$output .= $row['model_make_id'] .'<br/>';
}
return $output;
And it is return everything? How can do the above and what the best most efficient way of doing this? Because if several or 100 of users make these queries often, won't it affect the server's performance?