This question already has an answer here:
The code that i have written is a form that adds new record in to table called "listings". But in the table it shows me the new record with the id but the other values not showing or do not have import.
<?php
$con = mysqli_connect("", "", "", "");
if($con === false)
{
die("ERROR: Could not connect. " . mysqli_connect_error());
}
$listings_title = $_POST['listings_title'];
$listings_short_desc = $_POST['listings_short_desc'];
$listings_description = $_POST['listings_description'];
$listings_category = $_POST['listings_category'];
$listings_tags = $_POST['listings_tags'];
$listings_city = $_POST['listings_city'];
$listings_address = $_POST['listings_address'];
$listings_workingdays = $_POST['listings_workingdays'];
$sql = "INSERT INTO listings2019 (listings_title, listings_short_desc, listings_description, listings_category, listings_tags, listings_city, listings_address, listings_workingdays) VALUES ('$listings_title', '$listings_short_desc', '$listings_description', '$listings_category', '$listings_tags', '$listings_city', '$listings_address', '$listings_workingdays')";
if(mysqli_query($con, $sql)) {
echo "New record created successfully.";
} else {
echo "Error: Could not able to execute $sql. " . mysqli_error($con);
}
mysqli_close($con);
?>
<html>
<body>
<form action="includes/db.php" method="post">
Title : <input name = "title" type = "text" >
<br/>
Description : <input name = "description" type = "text">
<br/>
Category : <input name = "category" type = "text">
<br/>
Tags : <input name = "tags" type = "text">
<br/>
City : <input name = "city" type = "text">
<br/>
Address : <input name = "address" type = "text">
<br/>
Workingdays : <input name = "workingdays" type = "text">
<br/>
Images: <input type="file" name="listing_image" />
<br />
<input type="submit" value="Insert"/>
</form>
</body>
</html>
stings_title, listings_short_desc, listings_description, listings_category, listings_tags, listings_city, listings_address, listings_workingdays) VALUES ('$listings_title', '$listings_short_desc', '$listings_description', '$listings_category', '$listings_tags', '$listings_city', '$listings_address', '$listings_workingdays')";
if(mysqli_query($con, $sql)) {
echo "New record created successfully.";
} else {
echo "Error: Could not able to execute $sql. " . mysqli_error($con);
}
mysqli_close($con);
</div>