08-02-2008, 07:39 PM
|
#2 (permalink)
|
|
The Wanderer
Join Date: May 2008
Posts: 17
Thanks: 2
|
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.
|
|
|
|