Corrected error on a mysql query