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?
so basically something like this,
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;
}
}
Like I said, I am still new to classes, so any advice or help would be greatly appreciated!
Thanx in advance!
First build a MySQL class library… suiting the requirements like in this sample piece:
and the configuration file…