Skip to content
Advertisement

use not equal to in custom function in codeigniter

I have made a function named __getwheredata in MY_Controller:

JavaScript

I need to get data where field is not equal to 1.

so I call the function like:

JavaScript

but here array('rights!='=>1) will pass as array in value of the where condition.

so how can I resolve this issue ?

Advertisement

Answer

Maybe you need to stringify the whole array like this:

JavaScript

Now it will generate where statements as a string like this rights!=1


Edit: or you can do it like this:

JavaScript

Now your function would look like this:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement