-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmit_data.php
More file actions
31 lines (23 loc) · 816 Bytes
/
Copy pathsubmit_data.php
File metadata and controls
31 lines (23 loc) · 816 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
30
31
<?php
$servername = "localhost";
$username = "root"; // replace with your MySQL username
$password = "Phatsaxman1*"; // replace with your MySQL password
$dbname = "windowwashing"; // replace with your database name
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Prepare and bind
// The SQL statement was missing a closing parenthesis for the fields list
$stmt = $conn->prepare("INSERT INTO customer (customer_name, customer_email) VALUES (?, ?)");
$stmt->bind_param("ss", $name, $email);
// Set parameters and execute
$name = $_POST['name'];
$email = $_POST['email'];
$stmt->execute();
echo "New records created successfully";
$stmt->close();
$conn->close();
?>