Wiki

Articles tagged with "cdbcriteria", sorted by date (updated)X
Displaying 1-4 of 4 result(s).

Using sub query for doubletts

Updated about a month ago by mbTips3 comments – viewed 3,771 times – ( +1 )
find doubletts by db fields. in this example i will check doublets for 3 tabelfields (col1,col2,col3). so i will get a subquery with the condition, select and grouping of the tablefields. the having with COUNT() > 1 means: find all records more then one result.

Custom Archive in Blog system

Updated 9 months ago by nirmalrokaTips0 comments – viewed 2,253 times – ( +1 )
Hi I had made simple archive system for blog system that can handle tbl_post. I had used simple CDbCriteria not more than that. I know there is more and many better way to this but I think this will give some idea to users to generate new idea or customized or modified this version of code.

1:n relations sometimes require CDbCriteria.together

Updated about a year ago by fsbTips4 comments – viewed 13,826 times – ( +13 )
There are situations in which Active Record will generate nonsense queries from what a nieve Yii user might think is reasonable code. One such situation is a CActiveDataProvider using CDbCriteria to get data from parent and 1:n child table with a condition on the child table.

Search method of a model for filters when using dates - unixtimestamp in database

Updated about a year ago by jwernerTips1 comment – viewed 15,031 times – ( +10 )
I ran into a problem and on irc we worked it out. Since there is a lack on information on filters in genral i thought i'd start sharing all my findings, might be usefull for other people.