i dont know what your script does
but a select query has no sense if its not used later in the script, where is the fetch_array or the num_rows??????
if you think your scripts look dirty you might try using some more coding standarts...
formating the code over several lines, calling array with $x['name'] instead of $x[name] and so on...