Gentlemen, i am having an error here and your help would be much appreciated
my code is below and this is the error i am getting:
PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/SANDBOX/PHP/.php on line 14
<?php
$con=mysqli_connect("localhost","USER","PASSWORD","DATABASE");
// Check connection
if (mysqli_connect_errno()){
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
if($_POST[process]=="btn_add"){
$result = mysqli_query($con,"INSERT INTO users (user, password, type) VALUES ('".$_POST['user']."','".$_POST['password']."','".$_POST['type']."')" );
}else if($_POST[process]=="btn_update"){
$result = mysqli_query($con,"UPDATE users SET user='".$_POST['user']."', password='".$_POST['password']."', type='".$_POST['type']."' WHERE id='".$_POST['id']."' ;");
}else if($_POST[process]=="btn_delete"){
$result = mysqli_query($con,"DELETE FROM users WHERE id='".$_POST['id']."';");
}while($result = mysqli_fetch_array($row)){
echo $row['type'] ;
}
mysqli_close($con);
?>