//phpinfo(); session_start(); include_once("db.php"); if(isset($_POST['submit'])){ $uname=$_POST["email"]; $pwd=$_POST["password"]; $sqlquery="select * from admin_users where userName='$uname' and password='$pwd'"; $data=mysqli_query($q,$sqlquery); //$res=mysql_num_rows($data); $rcc=mysqli_fetch_assoc($data); if($rcc==0) { $msg = "Invalid Credentials"; } else { echo $_SESSION['id'] = $rcc['userId']; echo $_SESSION['firstName'] = $rcc['firstName']; header("location:dashboard.php"); } } ?>