when i log on to my user account it shows these warning:-
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /hermes/bosnaweb24a/b1323/ipg.techbitercom1/duracomexteriors/admin/action/action_login.php on line 12 Warning: Cannot modify header information - headers already sent by (output started at /hermes/bosnaweb24a/b1323/ipg.techbitercom1/duracomexteriors/admin/action/action_login.php:12) in /hermes/bosnaweb24a/b1323/ipg.techbitercom1/duracomexteriors/admin/action/action_login.php on line
i'm attaching my action_login.php code
<?php
require_once("../../db_connection/dbConnection.php");
session_start();
if(isset($_POST["ok"])){
$username=$_POST["username"];
$password =$_POST["password"];
if(mysqli_query($con, "select * from tbl_admin_log where user_name='$username' or email='$username' and password='$password'")){
$_SESSION["login"] = $username;
$_SESSION["passw"] = $password;
while($ln = mysqli_fetch_array($log, MYSQLI_ASSOC)){
$_SESSION["log_type"] = $ln["type"];
}
header("location:../admin.php");
}
else{
header("location:../index.php?failed=Invalid Username or Password!");
}
}
?>