Wiki

Articles tagged with "cdbcriteria"X
Displaying 1-4 of 4 result(s).

Custom Archive in Blog system

Created 9 months ago by nirmalrokaTips0 comments – viewed 2,354 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.

Using sub query for doubletts

Created 10 months ago by mbTips3 comments – viewed 3,957 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.

1:n relations sometimes require CDbCriteria.together

Created about a year ago by fsbTips4 comments – viewed 14,537 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

Created 2 years ago by MukkeTips1 comment – viewed 15,370 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.