-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrite_page.php
More file actions
29 lines (26 loc) · 803 Bytes
/
write_page.php
File metadata and controls
29 lines (26 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "stores";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$name = $_POST["name"];
$description = $_POST["description"];
$promotion = $_POST["promotions"];
$lat = $_POST["lat"];
$long = $_POST["long"];
$vacancy = $_POST["vacancy"];
$sql = "INSERT INTO stores (Name, Description, Promotions, LatLoc, LongLoc, Vacancy)
VALUES ('$name', '$description', '$promotion','$lat','$long','$vacancy')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>