I am trying to get a users ID from a database within a class, but I have very little to no experience with classes, how could I go about getting the uid from the DB and then
Do everything for a reason. Don't use things you don't know. Go and learn them instead.
One may give you an answer for this specific question, but until you don't know what Object Oriented means and why there are classes at all, you shouldn't use them.