i used this code and i didnt get any errors but when i check the phpadmin and my database its all empty no data added to the table what should i do ? where is the problem?
i checked also my database and table values and my html names
<?php
if(isset( $_POST['submit'] ) )
{
$name = $_POST['p_name'];
$price = $_POST['p_price'];
$type = $_POST['p_type'];
$des = $_POST['p_desc'];
$img = 'images/is7.jpeg';
//***********************
require_once 'setting.php';
$dbc = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
mysqli_set_charset($dbc, 'utf8');
$query = "INSERT INTO products(name, price, type, des, img)
VALUES('$name', '$price', '$type', $des, '$img')";
mysqli_query($dbc, $query);
mysqli_close($dbc);
header('Location: success.php');
exit;
}
?>
echo mysqli_error($dbc);aftermysqli_query($dbc, $query);