prepare($query); // Bind parameters $stmt->bind_param("sss", $_POST['title'], $_POST['description'], $_POST['link']); // Execute the statement $result = $stmt->execute(); if ($result === true) { echo 'Success'; } else { echo 'Error updating about us: ' . $stmt->error; } break; case 'our_aim': // Prepare the SQL statement with placeholders $query = "UPDATE `our_aim` SET `title` = ?, `description` = ? WHERE `our_aim`.`id` = 1"; // Prepare the statement $stmt = $con->prepare($query); // Bind parameters $stmt->bind_param("ss", $_POST['title'], $_POST['description']); // Execute the statement $result = $stmt->execute(); if ($result === true) { echo 'Success'; } else { echo 'Error updating our aim: ' . $stmt->error; } break; case 'get_touch': // Prepare the SQL statement with placeholders $query = "UPDATE `get_in_touch` SET `title`=?, `map_url`=?, `address`=? WHERE `id` = 1"; // Prepare the statement $stmt = $con->prepare($query); // Bind parameters $stmt->bind_param("sss", $_POST['title'], $_POST['map'], $_POST['address']); // Execute the statement $result = $stmt->execute(); if ($result === true) { echo 'Success'; } else { echo 'Error updating get in touch: ' . $stmt->error; } break; case 'achievements': $query = "INSERT INTO `achievement` (`id`, `title`, `description`,`heading`) VALUES (NULL, '" . $_POST['title'] . "', '" . $_POST['description'] . "','".$_POST['heading']."')"; $result = $con->query($query); if ($result === true) { echo 'Success'; } else { echo 'Error inserting achievement'; } break; case 'popular_courses': $imageData = file_up('image','content'); $image = ($imageData['status']) ? $imageData['file_name'] : ''; $sql = "INSERT INTO `popular_courses` (`id`, `image`, `title`, `btn`, `btn_link`) VALUES (NULL, '".$image."', '".$_POST['title']."', '".$_POST['btn_name']."', '".$_POST['btn_link']."')"; $result = $con->query($sql); if ($result === true) { echo 'Success'; } else { echo 'Error inserting Popular Course'; } break; } ?>