Yii Framework Forum: Taking Two Databases - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Taking Two Databases Rate Topic: -----

#1 User is offline   kareem 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 09-May 14

Posted 09 May 2014 - 11:41 AM

Hi All,

I got error when the login name is not matched with data base

my code is

if($model->validate() && $model->login())
//$this->redirect(Yii::app()->user->returnUrl);
/**/
$username=Yii::app()->user->name;
//echo $username;
$result = Yii::app()->db->createCommand()
->select('clientid, role')
->from('master.user')
->where('username=:username', array(':username'=> $username))
->queryRow();
//$user = $result['username'];
$clientid = $result['clientid'];
$role = $result['role'];

/**/
if($role=='masteradmin')
{
$this->redirect(array("/user/admin"));

}
else if($role=='admin')
{

$this->redirect(array("/user/admin&User%5Bclientid%5D=$clientid"));

}
else if($role=='employee')
{

$this->redirect(array("/AshaVendorProfile"));

}



am new for yii please help me ..
am using two databases...

Attached File(s)


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users