Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include '../session.php';
- require_once 'config.php';
- if (isset($_POST['submit'])) {
- $imageName = $_FILES["latest_photo"]["name"];
- $imageData = file_get_contents($_FILES["latest_photo"]["tmp_name"]);
- $imageType = $_FILES["latest_photo"]["type"];
- if (substr($imageType, 0,5) == "image") {
- $query = "UPDATE `crew_info` SET `image_name` = ? AND `updated_photo` = ? WHERE `id` = ?";
- $stmt = mysqli_prepare($conn, $query);
- mysqli_stmt_bind_param($stmt, 'ssi', $imageName, $imageData, $_POST['id']);
- mysqli_stmt_execute($stmt);
- }
- else {
- echo "Image not Uploaded!";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement