Yii Framework Forum: [ASK] Pencarian berdasarkan Bulan - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

[ASK] Pencarian berdasarkan Bulan CDbCriteria Rate Topic: -----

#1 User is offline   giantdut 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 24-April 12
  • Location:Jakarta, Indonesia

Posted 22 May 2012 - 10:19 AM

	public function monthly($month,$limit)
	{
	    $this->getDbCriteria()->mergeWith(array(
			'condition' => 'tanggal=:tanggal',
			'params' => array(':tanggal' => $month),
	        'limit'=>$limit,
	    ));
	    return $this;
	}	 


Permisi kalo db criteria diatas cara ambil per bulannya gimana yah?
Try to explore my intellectual capital
0

#2 User is offline   giantdut 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 24-April 12
  • Location:Jakarta, Indonesia

Posted 22 May 2012 - 11:33 AM

	public function monthly($month,$limit)
	{
	    $this->getDbCriteria()->mergeWith(array(
			'condition' => 'MONTH(tanggal)=:tanggal',
			'params' => array(':tanggal' => $month),
	        'limit'=>$limit,
	    ));
	    return $this;
	}	 


SOLVED ternyata bisa langsung begitu...
Try to explore my intellectual capital
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users