Untitled

 avatar
unknown
plain_text
a year ago
572 B
5
Indexable
<?php
$sr="localhost";
$user="root";
$pass="";
$dbname="cafe";
$conn = new mysqli($r, $user, $pass, $dbname);

// Check the connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// Get data from the form
$pname = $_POST['**'];
$price = $_POST['**'];

// Insert data into the "drinks" table
$sql = "INSERT INTO **";

if ($conn->query($sql) === TRUE) {
    echo "Drink added successfully";
} else {
    echo "Error: " . $sql . "<br>" . $conn->error;
}

// Close the database connection
$conn->close();
?>
Editor is loading...
Leave a Comment