If i buy an iphone off of amazon, can i use that on my at&t carrier?

I do not really know how to word it, but long story short i broke my phone. I have at&t but since my broken phone is older, they don't carry them in the store anymore. So not really thinking i just went on amazon and bought an iphone. Will i be able to use that phone with the number i already have?

If it's the newer iPhone, they tend to come "unlocked," so yes, you can.

If its unlocked then sure

Yes, you can use the phone on AT&T but make sure the phone is AT&T iPhone or unlocked iPhone.