Yii Framework Forum: Implementasi Query Database - Yii Framework Forum

Jump to content

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

Implementasi Query Database Rate Topic: ***** 1 Votes

#1 User is offline   newbie17 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 05-August 13

Posted 05 August 2013 - 01:26 AM

mau nanya master-master sekalian, gimana ya cara implementasi query database dalam MVC???
ex:
SELECT daya_tampung FROM daya_tampung_S1 WHERE years=YEARS(CURDATE());

Mohon Pencerahannya
0

#2 User is offline   codesutra 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 596
  • Joined: 15-March 11
  • Location:India

Posted 05 August 2013 - 04:13 AM

View Postnewbie17, on 05 August 2013 - 01:26 AM, said:

mau nanya master-master sekalian, gimana ya cara implementasi query database dalam MVC???
ex:
SELECT daya_tampung FROM daya_tampung_S1 WHERE years=YEARS(CURDATE());

Mohon Pencerahannya


Do, you want to execute this Query in Yii ??

If yes then for better understanding please read this link

You'll get more idea ;)

and

you can execute your query like

Yii::app()->db->createCommand('SELECT daya_tampung FROM daya_tampung_S1 WHERE years=YEARS(CURDATE())')->query();


Lets read that link thoroughly.you'll better understand everything.
CodeSutra
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