Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. $model = Users::model()->findByAttributes(array('googleid'=>$google_id));
  2. if($model)
  3. {
  4. echo "Good";
  5. }
  6. else
  7. {
  8. echo $model->googleid = $google_id;
  9.  
  10. $model->save();
  11. }
  12.  
  13. Fatal error: Call to undefined method stdClass::save() in E:wampwwwcustomersprotectedviewsusersgooglelogin.php on line 76
  14.  
  15. $model = Users::model()->findByAttributes(array('googleid'=>$google_id));
  16. if($model)
  17. {
  18. echo "Good";
  19. }
  20. else
  21. {
  22. $model_new = new Users;
  23. echo $model_new->googleid = $google_id;
  24. $model_new->save();
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement