I am trying to adapt OOP here and was wondering if php can handle it.

I have a class i that i want to use to access various table with similar culmn names from mysql database and was wondering if the following code will do what i want?
PHP Code:
private $table;
    private 
$query;
    private 
$databaseURL "127.0.0.1";
    private 
$databaseUName "root";
    private 
$databasePWord "password";
    private 
$databaseName "8BallPool";
    private 
$connection;



    public function 
__construct($tableName) {


        
$this->connection mysql_connect($this->databaseURL,$this->databaseUName,$this->databasePWord
        or die (
"Error while connecting to host");
        
$db mysql_select_db($this->databaseName,$this->connection
        or die (
"Error while connecting to database");
        
$this->query "SELECT * FROM `$tableName`";
        
$this->table mysql_query($this->query);
        
    }




    function 
getPool(){
        return 
$this->table;
    }

    function 
get_pumpCost(){
        
$sql "SELECT poolCost FROM `getPool()` WHERE id = `1`";
        
$sqls mysql_query($sql);
    } 
will the construct hold the table object so the other function can make use of it?