i have been lately introduced to method chaining, and am not sure if what I\'m doing here is illegal, or I\'m doing it wrong. I have a database Class like:
c
If you want to using method chaining, what you should do is return $this
.
public function query($query)
{
$this->last_query = $query;
$this->resultset = mysql_query($query, $this->connection);
return $this;
}
Then you can do this:
$db->query("SELECT * FROM users WHERE name='JimmyP'")->fetchObject();