Hello to all,
I am trying to create an admin panel so that admin can insert data into database.
This is my code
<?php
include("connection.php");
if (isset($_POST['submit'])) {
$name = $_POST["name"];
$brand = $_POST['brand'];
$quantity = $_POST['quantity'];
$detail = $_POST['detail'];
$unit = $_POST['unit'];
$color = $_POST['color'];
$material = $_POST['material'];
$image = $_POST['image'];
$sql = "Insert into flood_light (Name, Brand, Quantity, Detail, Unit, Color, Material, Image) values('$name', '$brand', '$quantity', '$detail', '$unit', '$color', '$material', '$image')";
// $sql1 = "update flood_light set Name = $name "
$result = $conn-> query($sql);
if ($result === true) {
echo "data inserted successfully."."<br>";
}
else
{
echo "error"."<br>". $conn->error;
}
}
?>
It work's fine.
I want to add another query also (update query). If I add one more query then how can i mention it in form?
Means,
I have designed a form in html and admin can insert data by filling the information.
I just want to set a condition "If admin enters different information with same image then information will be update for that image".