where is the problem? anyone tell me because line 17 code does not have a problem then why this error shows
Parse error: syntax error, unexpected 'if' (T_IF) in C:\xampp\htdocs\project\selected\adminlogincheck.php on line 17
<?php
session_start();
$con = mysqli_connect('localhost','root');
if($con){
echo " conection successful";
}else{
echo"connection failed";
}
$db = mysqli_select_db($con, ' cbe schedular ');
if(isset($_POST['submit'])){
$email= $_POST ['email'];
$password = $_POST['password'];
$sql =" select *from admin where email = '$email' and password ='$password'";
$query = mysqli_query($con,$sql);
$row = mysqli_num_rows(){
if($row == true){
echo"login susccessful";
$_SESSION['user'] = $username;
header('location : adminmainpage.php');
}else{
echo "login failed";
header('location:adminlogin.php');
}
?>
after correction
<?php
session_start();
$con = mysqli_connect('localhost','root');
if($con){
echo " conection successful";
}else{
echo"connection failed";
}
$db = mysqli_select_db($con, ' cbe_schedular ');
if(isset($_POST['submit'])){
$email= $_POST ['email'];
$password = $_POST['password'];
$sql =" select *from admin where email = '$email' and password ='$password'";
$query = mysqli_query($con,$sql);
$row = mysqli_num_rows();
if($row == true){
echo"login susccessful";
$_SESSION['user'] = $username;
header('location :../adminmainpage.php');
}else{
echo "login failed";
header('location:adminlogin.php');
}
}
?> not redirect to adminlogin.php just show conection successful