title: PHP database connection class
body: <p>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 return the uid?</p>
  
  <p>so basically something like this,</p>
  
  <pre><code>class hello {
     public function getUid(){
        //connect to the db
        //get all of the users info
        $array = mysql_fetch_array($result);
        $uid = $array['uid'];
  
        return $uid;
     }
  }
  </code></pre>
  
  <p>Like I said, I am still new to classes, so any advice or help would be greatly appreciated!</p>
  
  <p>Thanx in advance!</p>