I made a form with the code below. As you can see at the bottom of the picture. When I tried submit the data into my database, the data wasn’t inserted.
HERE IS MY db_connection.php
<?php
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "";
$db = "test";
$conn = new mysqli_connect($dbhost, $dbuser, $dbpass, $db);
?>
Here is my signup.php
<?
include_once 'db_connection.php';
if(isset($_POST['submit'])){
if(!empty($_POST['name']) && empty($_POST['owner']) && empty($_POST['location']) && empty($_POST['region']) && empty($_POST['district']) && empty($_POST['street']) && empty($_POST['mobile']) && empty($_POST['address']) && empty($_POST['email'])){
$name = $_POST['name'];
$owner = $_POST['owner'];
$location = $_POST['location'];
$region = $_POST['region'];
$district = $_POST['district'];
$street = $_POST['street'];
$mobile = $_POST['mobile'];
$address = $_POST['address'];
$email = $_POST['email'];
$sql = "INSERT INTO agency_details ('name', 'owner', 'location', 'region', 'district', 'street', 'mobile', 'address', 'email') VALUES ('$name', '$owner', '$location', '$region', '$district', '$street', '$mobile', '$address', '$email');";
$RUN = mysqli_query($conn, $sql);
header("Location:./index.php?signup=success");
}
}
?>