Yii Framework Forum: pencarian record database - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

pencarian record database Pencarian berdasarkan tanggal Rate Topic: -----

#1 User is offline   Rayhan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 01-May 12

Posted 01 May 2012 - 08:55 PM

halo gan , salam kenal
saya baru nih di yii, "tuntutan kantor sih" . haha

saya mau tanya . coding pencarian record database berdasarkan tanggal tuh gimana ??

sebenernya gampang sih di bikin di gii , tapi saya pengen dasarnya gan .
tolong bantu ya :)
0

#2 User is offline   tito cah amikom 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 06-February 12

Posted 04 May 2012 - 09:10 PM

mungkin bisa membantu gan pake cdbcriteria

$now = "12 Januari 2011"
$date = date('Y-m-d',strtotime("$now"));//untuk mengubah type data date di database

$criteria = new CDbCriteria();
$criteria->condition = "field_tanggal=:date_data";
$criteria->params = array(':date_data'=>$date);

$model = Model_yg_digunakan::model()->findAll($criteria);
1

#3 User is offline   wonk4rol 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 02-May 12
  • Location:Indonesia

Posted 15 May 2012 - 11:05 PM

View Posttito cah amikom, on 04 May 2012 - 09:10 PM, said:

mungkin bisa membantu gan pake cdbcriteria

$now = "12 Januari 2011"
$date = date('Y-m-d',strtotime("$now"));//untuk mengubah type data date di database

$criteria = new CDbCriteria();
$criteria->condition = "field_tanggal=:date_data";
$criteria->params = array(':date_data'=>$date);

$model = Model_yg_digunakan::model()->findAll($criteria);


Terima kasih gan, coding ente memberikan ane pencerahan.
0

#4 User is offline   ahmadroni 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 250
  • Joined: 14-June 09
  • Location:Yogyakarta-Indonesia

Posted 24 May 2012 - 12:22 AM

selamat berjuang dengan Yii...
Hospital Cost Management System and
Hospital Management Information System
0

#5 User is offline   Vataraxia 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 27-June 12
  • Location:Jakarta

Posted 13 July 2012 - 05:05 AM

gan, mau lanjutin nanya, kalo sql sprti ini:

$tampung = select name from tbl_customer where lower(code) like 'cd%' limit 1;

kalo memakai cdbcriteria jadinya gmn gan?
Where there's a will, there's a way
0

#6 User is offline   mbahsomo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 40
  • Joined: 29-March 10

Posted 02 September 2012 - 11:59 PM

Mungkin bisa menggunakan ini :
$criteria->compare('lower(code)', strtolower($this->code), true);


Merdeka.
Sugik Puja Kusuma [mbahsomo]
http://sugik.do-event.com
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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