Well in your SQL you would have ORDER BY hotlink DESC
(no = 1 bit). This would order the rows in decending order, putting all the records with hotlink = 1 first in the set. If you want to then say order by name in ascending order, you can also sort by that… ORDER BY hotlink DESC, name ASC
.
Now I am assuming that hotlink only has two possible values 1 and 0. If that is the case, then it is just a matter of looping through your set and for each row that has hotlink == 1, you show the star, else don’t show the star (what you show there).
This should give you the desired result of having all those with hotlink = 1 at the top and sorted by name, with the ones without stars below those. Of course make the necessary tweaks if hotlink has other values. They should be minor changes.
I hope this helps.