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();

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Chinese version
Chinese version, very easy to use

Notepad++7.3.1
Easy-to-use and free code editor

Dreamweaver Mac version
Visual web development tools
