I cannot find out what's wrong in this code. Since the query executes and insert also works but the error msg shows:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given on line no 22. I cannot solve this.
<?php
require_once('db_config.php');
if($_SERVER['REQUEST_METHOD']=='POST')
{
$name = $_POST['Name'];
$mob = $_POST['Mob'];
$username = $_POST['Username'];
$password = $_POST['Password'];
$sql = "INSERT INTO user (name,phone,username,password) VALUES ('$name','$mob','$username','$password')";
$result = mysqli_query($con,$sql) or die("Error: ".mysqli_error($con));
$check = mysqli_fetch_array($result);
if(isset($check)){
echo "sucess";
}else{
echo "error";
}
mysqli_close($con);
}
?>