If you had a kidney infection, you were prescribed the correct antibiotic therapy. Unfortunately, you had an adverse effect to Gatifloxacin. However, in most cases Bactrim is a good choice to treat kidney infection as well. Since you did not tell the infecting organism, it is difficult to comment on the best therapy. It is advisable that you finish your antibiotic course (which in most cases is maximum of 2 weeks) and then your urine culture be repeated to confirm the eradication of infection.
In addition, unless you are a female, your physician must determine the reason of your infection so it can be prevented in future. Some of the common causes include stone disease, diabetes, prostate infection, etc.