There are multiple methods in a class. When you instantiate this class and call the methods, you can only call them one by one, similar to:
db.php
<?php<br /><br />class db<br />{<br /> public function where()<br /> {<br /> //code here<br /> }<br /> public function order()<br /> {<br /> //code here<br /> }<br /> public function limit()<br /> {<br /> //code here<br /> }<br />}
index.php
<?php<br /><br />$db = new db();<br /><br />$db->where();<br>$db->order();<br>$db->limit();
If you want to implement chained calls, just add return $this at the end of the method.
db.php
<?php<br /><br />class db<br />{<br /> public function where()<br /> {<br /> //code here<br /> return $this;<br /> }<br /> public function order()<br /> {<br /> //code here<br /> return $this;<br /> }<br /> public function limit()<br /> {<br /> //code here<br /> return $this;<br /> }<br />}
index.php
<?php<br /><br />$db = new db();<br /><br />$db->where()->order()->limit();