Quantcast
Channel: Shani's Php CookBook
Viewing all articles
Browse latest Browse all 60

yii, Executing a SQL without calling a Model

$
0
0
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);
?>




Viewing all articles
Browse latest Browse all 60

Trending Articles