This service has been discontinued

If you are a company selling whmcs modules and you are interested in our code you can contact us with an offer at info at whmcstricks dot com
All other requests will be ignored.

WHMCS Database Select and loop through results

February 25, 2017

Let's take a look at a simple operation with the database today.

Before using this code you should initialise capsule as written in this post.

Let's say we want to retrieve all the active domains  and then loop through them, we can simply use this code:

 $result = Capsule::table('tbldomains')->where('status', 'Active')->get();

 foreach ($result as $data)
     $id = $data->id;