Codeigniter common select query


This is the codeigniter function for common select query that you need to place in model. and call it from controller. suppose your model name is say “basic_model” than you need to call this function in controller like..


Parameter understanding :

$select           : string of database table column in comma separated or * for all column
$from             : string of database table name
$where          : An associative array in which array key should be table column and array value would be table column value
$group          : an array of database column e.g array(“user_id”) so it gives output as group by user_id
$order           : string of database column with ASC or DESC parameter e.g ‘user_id DESC’
$having        : string of database column with condition say sum(‘coin’) > 0
$limit            : an array of limit string e.g array(“10,0″) so this gives output as limit 0,10
$result_way : string for output way
$echo           : 0 or 1 . if you want the query string from codeigniter than set this value as 1

By changing the query guide functionality you can use this function for other framework or in cms.

Read More

Disallowed Key Characters In Codeigniter

This may occur because of cookie problem for your browser so for removing this error you need to test this url in separate browse or clear the cookie for your browser.i if you use google chrome than press ctrl + shift + n so that take you on new google chrome instance at where you can see that your link may work.

The cookie is __utmt. A Google Analytic cookie. The ~Number part probably means it’s a copy/duplicate. Think of it like the word.doc~1 files that are stored on your computer when working in a Word doc.

So first, check your Analytic code on the website, is the a duplicate somewhere? My problem was solved by altering this duplicated line:

Weird thing is that the file always had this duplicated line of code, for as far as my GIT goes back. It might be a change in the way analytics code handles cookies…

Oh, and the “Disallowed Key Characters” part. That’s normally a good thing, protecting your CI app against evil.

Its in the system\core\Input.php file.

Read More