Confused

Hie Ladies i went to the doctor as i was having severe cramps and back pain, i was actually on my period but it was light because I normally have heavy flow , so the doc said i was pregnant but also have bladder infection, so i was given medication for the infection , then after 3 days i bought my home preg test and it came out negative , I'm worried and confused , I don't know if I'm pregnant or not .