-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_notes.php
More file actions
23 lines (18 loc) · 803 Bytes
/
update_notes.php
File metadata and controls
23 lines (18 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
<?php
// Include the database connection file
include_once 'db_connection.php';
if(isset($_POST['editSNo']) && isset($_POST['editNoteTitle']) && isset($_POST['editNoteDesc'])){
// Get the values of the editSNo, editNoteTitle, and editNoteDesc POST variables
$editSNo = $_POST['editSNo'];
$editNoteTitle = $_POST['editNoteTitle'];
$editNoteDesc = $_POST['editNoteDesc'];
$updateQuery = "UPDATE notes SET Title='$editNoteTitle', Description='$editNoteDesc' WHERE SNo='$editSNo'";
$updateResult = mysqli_query($conn, $updateQuery);
if ($updateResult)
echo "Note updated successfully";
else
echo "Error updating note: " . mysqli_error($conn);
}
// Include the read_notes.php file to read the notes from the database
include_once 'read_notes.php';
?>