View Single Post
Old 08-02-2008, 06:39 PM   #2 (permalink)
Alex
The Wanderer
 
Join Date: May 2008
Posts: 17
Thanks: 2
Alex is on a distinguished road
Default

PHP Code:
class MyClass 

  public function 
instSql() 
  { 
    return new 
Sql
  } 

class 
Sql 

  private function 
Sql() // Constructor 
  

    
// Connect to the database, blah blah blah 
    
return $this
  } 

  public function 
Query() 
  { 
    
// Send a query 
    
return $result
  } 



// Later... 

$cl = new MyClass
$cl->instSql()->Query(); 
The instSql() should return an instance of an object, then you can 'chain' the calls.
Alex is offline  
Reply With Quote