Guest User

Untitled

a guest
Jan 21st, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. $model = User::findOne(['id' => 1]);
  2.  
  3. $model = User::find('username','email')->where('id'=1)
  4.  
  5. $model = User::find()
  6. ->select('column1, column2')
  7. ->where(['id' => $id])
  8. ->one();
  9.  
  10. echo $model->column1;
  11.  
  12. $model = User::find()->select(['username','email'])->where('id=1')->One();
  13.  
  14. $model = User::find()->select(['username','email'])->where('id=:id', [ ':id' => 1 ])->One();
  15.  
  16. $model = User::find()
  17. ->select(['column1', 'column2'])
  18. ->where(['id' => $id])
  19. ->one();
  20.  
  21. $model = User::find()->select(['username','email'])->where('id=1')->One();
Add Comment
Please, Sign In to add comment