Laser, sorry I misunderstood at first, I was under the impression of changing the sort in the database, I have gotten myself a coffee in order to disallow this from happening again.
Also, I have changed the query to include: "order by model ASC" and scrapped the first useless bubble sort all together.
It is still quite slow.
The function here, is obviously what is doing it, is there a way then, to check the number of occurences of each string, and return an array of the top 10 or so results?
for($x = 0; $x < $array_size; $x++) {
for($y = 0; $y < $array_size; $y++) {
if($modnum[$x] > $modnum[$y]) {
$hold = $modnum[$x];
$modnum[$x] = $modnum[$y];
$modnum[$y] = $hold;
$hold = $modname[$x];
$modname[$x] = $modname[$y];
$modname[$y] = $hold;
}
}
}
echo "<hr><b>Top 10 Models:</b><br><br>\n";
for($x = 1; $x <= 10; $x++) { // Display all the models and Their counts
echo $modname[$x]." - ".$modnum[$x]."<br>\n";
}
Regards,
Michael (big nerd)