Wednesday 13 April 2016

YII, Executing a SQL without calling a Model



<?
$connection=Yii::app()->db;
$sql = "SELECT id,username FROM users";
$command = $connection->createCommand($sql);            
$dataReader=$command->query();          
$rows=$dataReader->readAll();
print_r($rows);
?>

No comments:

Post a Comment

Setup VueJS in Laravel

Setup VueJS in Laravel 1. You will need to install javascript dependencies by running the following command on your terminal.      npm i...