Update: 2026-06-11 18:22:57
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
include "../connect.php";
|
||||
|
||||
// Retrieve and sanitize input parameters
|
||||
$phone = filterRequest("phone");
|
||||
$note = filterRequest("note");
|
||||
$editor = filterRequest("editor");
|
||||
|
||||
// SQL query to insert a new note into the notesForDriverService table
|
||||
$sql = "INSERT INTO `notesForDriverService` ( `phone`, `note`, `editor`)
|
||||
VALUES (:phone, :note, :editor)";
|
||||
|
||||
// Prepare the SQL statement
|
||||
$stmt = $con->prepare($sql);
|
||||
|
||||
// Bind the parameters
|
||||
$stmt->bindParam(':phone', $phone);
|
||||
$stmt->bindParam(':note', $note);
|
||||
$stmt->bindParam(':editor', $editor);
|
||||
|
||||
$stmt->execute();
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
// Print a success message
|
||||
printSuccess($message = "note inserted successfully");
|
||||
} else {
|
||||
// Print a failure message
|
||||
printFailure($message = "Failed to insert note");
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user