Couldn't you use the IN clause in your select statement and reduce the numbers of queries in your page.
Would eliminate your FOR LOOP all together.
$sql = "SELECT * FROM category, project_master WHERE category.catID IN ($new_cats) ORDER BY category.importance ASC";
Running a query several times for everything within your array is inefficient...
I'm not sure what data is stored within your array, but its probably not ordering because its only selecting 1 record at a time ... WHERE category.catID = ""
Its appears that each time the loop is going and the query is ran, its pulling only 1 record, until the next loop, where its pulling 1 again. So, it will never order the results, cause there is only 1 result each time. (hope that makes sense)
Use the IN clause, it will ORDER BY then for you..