forked from thejanRajapaksha/SW-Tools-and-Practices
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccept.php
More file actions
28 lines (22 loc) · 654 Bytes
/
accept.php
File metadata and controls
28 lines (22 loc) · 654 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
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "accommodationfinder";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Get property ID from the request
$id = $_GET['id'];
// Update status column to 'accepted' for the given property ID
$sql = "UPDATE advertisements SET status='accepted' WHERE advertisement_id=$id";
if ($conn->query($sql) === TRUE) {
echo "Status updated successfully";
} else {
echo "Error updating status: " . $conn->error;
}
$conn->close();
?>