Wiki

Articles in category "tips", sorted by viewsX
Displaying 71-80 of 97 result(s).

mysql performance tip

Created 8 months ago by sirin kTips6 comments – viewed 4,713 times – ( +2 / -1 )
When we are doing an insert of huge no.of rows into an SQL table ,Normally we will try to write separate insert quries this may lead us to a long duration of execution time and we can increase the speed of executing SQL quries by adding all the rows into a single insert query.
tags: mysql

Syntax check

Created 2 years ago by Russell EnglandTips2 comments – viewed 4,459 times – ( +4 )
So I've been busy making lots of modifications to my views/models/controllers - came to test the app and got a blank screen. Nothing in the application.log file so must be a syntax error somewhere... But which file?
tags: php, syntax

Yii CDBHttpSession数据库存储session性能优化实战

Created about a year ago by Darwin WenTips0 comments – viewed 4,351 times – ( +1 / -1 )
上一篇 关于 Yii CHttpSession性能优化篇之源码流程分析 有详细分析CHttpSession执行流程,在了解CHttpSession的详细执行流程之后,我们就可以非常轻松的扩展Yii Session,来优化和符合自己的业务流程。

Adding 'disabled' to CCheckBoxColumn and support for yiigridview.js

Created 6 months ago by Xgamer99Tips3 comments – viewed 3,964 times – ( +1 )
I recently had to have a checkbox column in my grid view that supported the 'disabled' attribute. This was easy enough to do by extending the CCheckBoxColumn. However, I also wanted the checkbox to be selected when clicking on the table's row (supported via CGridView's selectableRows option). I discovered I had to tweak yiigridview.js so that it would not select disabled rows when clicking on it or on the 'select all' checkbox.

关于Yii CHttpSession性能优化篇之源码流程分析

Created about a year ago by Darwin WenTips0 comments – viewed 3,799 times – ( +1 / -1 )
当我们使用Yii数据库去保存Session时,只要简单的配置就可以完成这个功能,在进行性能优化这个主题之前,我们先来查看一下CHttpSession和CDBHttpSession源代码,探讨CHttpSession和CDBHttpSession的流程再进行深一步优化主题。

Using sub query for doubletts

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

Yii shorten common functions with OOP style

Created 6 months ago by pdtkameTips3 comments – viewed 3,688 times – ( +9 / -14 )
This article will show how you can use Yii common functions as shorten OOP function. These functions will help you work with Yii common functions is easier as OOP style.

An important tip when you are using CArrayDataProvider.

Created 8 months ago by sirin kTips0 comments – viewed 3,642 times – ( +5 / -1 )
Yii ‘s CArrayDataProvider is very helpful to display model relation data's directly on it.But it is truely a confusing one because by default it will assume a table field named “id” as primary key for its pagination purpose and what if you dont have field named “id” as primary key on your table? so its truely confusing and if you tried to display without an “id” field on ur table you will get an error like “yourmodel.id is not defined”.

Adding a date range search for CGridView the easy way

Created 2 months ago by mikewalenTips2 comments – viewed 3,584 times – ( +6 )
After a lot of research, everything I found on adding date range searching to a CGridView advanced search form seemed to involve adding two new public variables (e.g. $date_from, $date_to), 'safe' rules for the new variables, and a rather chunky if/elseif/else check in the search() method. This probably isn't a hassle for most, but because many of the tables in my database contain two or three and sometimes four date columns (e.g. date_created, date_modified, date_deleted etc.), it meant I was having to add up to eight public variables, the corresponding safe rules, and modifying the search() criteria for each date attribute. So, I set about creating a better way and I thought I'd share my work with the community.

an easy way to required multi columns(At least one cannot be blank)

Created about a year ago by 1065227709Tips0 comments – viewed 3,495 times – ( +1 )
in model add the following code:
tags: rules