Skip to content

Instantly share code, notes, and snippets.

@yankchina
Created July 27, 2013 13:48
Show Gist options
  • Save yankchina/6094930 to your computer and use it in GitHub Desktop.
Save yankchina/6094930 to your computer and use it in GitHub Desktop.
db create command by QueryBuilder
$rows = Yii::app()->db->createCommand()
->from('tbl_Topic')
->where('status_code > 0')
->order('id desc')
->queryAll();
echo '<ul>';
foreach ($rows as $row ) {
echo '<li>'.$row['id'].'</li>';
}
echo '</ul>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment