I’m struggling around the following problem: into my database there are two table, with the following same structure Both tables have data about images, one for civil aircraft registrations, the other …
Tag: activerecord
Yii2 select2 database exception number of bound variables does not match number of tokens
when i use select2 widget in my yii 2 applicaton, it will cause the following error: The executed sql does not apply my override in find function of Page model as follow: Debug stack hint me to beforeInsert() function in ActiveRecord at line 333 & this code: Every thing seems ok, so whats wrong? Answer I had a same problem,
How do I add a filter on yii2 models
I have a query used to read data from a view. I am then applying a non related sql filter to this, to take out the models I don’t need and then returning an arrayDataProvider instance. The filter I am applying is the promotion period. However, when I pass query params to this search model, it doesn’t work. How do
CodeIgniter : how to write where_in OR where_in query?
I’m using codeigniter to query a database, and I need to conditionally compare arrays in the where clause. So basically I want to do: where_in OR where_in depending on what array has data in it. So I will have either an array of user_id OR an array of area_id’s. I’m not sure how to combine the where_in comparison. This is
How to fetch title of an item from a database and send it to the header template in CodeIgniter
I am writing an application in CodeIgniter where I specify the <title> meta-tag on every page in every controller which I have managed to send to my header template. However, now I have created an application that fetch credit cards and their titles from the database, through an CodeIgniter model. I would like to automatically fetch and use the credit
codeigniter multiple or where, disregards the where not
I am trying to create a list of users in the database of volunteers, based on those who are active members, and which jobs they volunteer for. problem is, it is including inactive members as well. Here is my controller Here is my model It seems that the or_where is completely overriding the where != DNR (Did not Renew) Help!
How to select rows where column value IS NOT NULL using CodeIgniter’s ActiveRecord?
I’m using CodeIgniter’s Active Record class to query the MySQL database. I need to select the rows in a table where a field is not set to NULL: That only returns this query: The archived field is a DATE field. Is there a better way to solve this? I know I can just write the query myself, but I want