Hey guys I’m rather new at yii and php ( and databases while we’re at it).
Anyway, here’s my query
foreach ($key as $id => $number) {
if ($id == 'year') {
$currentYear = $number;
} elseif ($id == 'subsection') {
$tutOrLab = Yii::app()->db->createCommand()
->select('courseID,kind,days,start_time,end_time,semester')
->from($id)
->where('id=' . $number)
->queryRow();
} else
$lec = Yii::app()->db->createCommand()
->select('courseID,kind,days,start_time,end_time,semester')
->from($id)
->where('id=' . $number)
->queryRow();
However, this selects multiple columns and creates a problem for me later when I want to do some comparison. I want to compare (for instance) if I want to compare start_time I have to do it as a string which creates huge issues after that. I read the “abstract data type” part here: http://www.yiiframework.com/doc/guide/1.1/en/database.query-builder but I don’t fully understand it. Any ideas on how i would need to do so?