如何从phpmyadmin引用值以将用户与客户分开?

I am trying to create a user login page. Upon successful registration admins are assigned a value of "A" in my database and customers a "C". Upon successful login customers will be directed to one page and admins to another. I created three session variables, their userId, userFName and their userType. I want to create an if statement to check the value of userType and have tried everything but I still get the error message "Parse error: syntax error, unexpected T_ELSE...on line 74".

`//create a session variable for this customer who has just logged in
//store his id and first name and usertype in this session variable     
$_SESSION['c_userid']=$userArray['userId'];
$_SESSION['c_fname']=$userArray['userFName'];
$_SESSION['c_usertype']=$userArray['userType'];

//if seperating customers from administrators
if ($userArray['userType']) 'C';
{
echo "<p>You are successfully logged in as a customer";
}
else;
{
echo "<p>You are successfully logged in as an administrator";
}`

I have also edited the if statement to include and "=" sign after the var but it returns the error message "Parse error: syntax error, unexpected '='....on line 70"

All and any help is much appreciated.

P.S newbie on a learning curve here so patience is appreciated. Been scratching my head all week over this but not making any progress. I have researched php.net etc so this question is a last resort.

This syntax is all wrong:

if ($userArray['userType']) 'C';

should be

if ($userArray['userType'] === 'C')
  • Everything goes in the parenthesis
  • no semi-colon after the parenthesis

    else;

should be:

else // no semi-colon