I'm trying to redirect my login into other page if the information are not correct. It seems the else statement is incorrect. please help me! thanks
syntax error, unexpected 'else' (T_ELSE)
<?php
$host="localhost";
$username="root";
$password="";
$dbname="oims2_db";
$tbl_name="administrator_tbl";
$tbl_name2="employee_tbl";
mysql_connect($host,$username,$password) or die("error for connect");
mysql_select_db($dbname) or die("error");
$AdminI = $_POST['AdminI'];
$AdminU = $_POST['AdminU'];
$AdminP = $_POST['AdminP'];
$sql="SELECT * FROM $tbl_name WHERE Admin_ID='$AdminI' and Admin_Username='$AdminU' and Admin_Password='$AdminP'";
$result=mysql_query($sql);
$count= mysql_num_rows($result);
$_SESSION["login_val"] = $count;
if($count==1)
{
echo "login successful " . $_SESSION{"login_val"};
header("location:1home.php");
}
$mysqli="SELECT * FROM $tbl_name2 WHERE Emp_ID='$AdminI' and Emp_Firstname='$AdminU' and Emp_Lastname ='$AdminP'";
$result1=mysql_query($mysqli);
$count1= mysql_num_rows($result1);
$_SESSION1["login_val1"] = $count1;
else
{
header("location:1portal.php");
}
?>