Monday 22 August 2016

How to write Sub Queries in Codeigniter Active Record ?

Codeigniter didn’t provided any option to use sub queries with active record class. So today i would like to provide simple and possible comprehensive techniques on “creating Sub Queries with Codeigniter Active Record”.
Creating sub query in Codeigniter is as easy as creating the regular Active Record queries. The technique here is first we need to generate a query and the generated query we need to inject it into the main query as sub Query.
So first we need to generate a sub query and store that generated query in a variable as a string. After generating sub query we will generate main query by suing previously genreated query as sub query.
For Example – I am going to generate blow query with active record methods
The NULL,FALSE in the where() method tells CodeIgniter not to escape the query.
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

No comments:

Post a Comment

Installation of Drop Box API on Codigniter

As with the YouTube API the first step in getting this sucker setup is getting a developer key by visiting  https://www.dropbox.com/develop...