Implementasi Query Database

mau nanya master-master sekalian, gimana ya cara implementasi query database dalam MVC???


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 ;)


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’ll better understand everything.