Manage AI Tool Blogs
0) { $blog = mysqli_fetch_assoc($result); $title = htmlspecialchars($blog['title']); $image_name = htmlspecialchars($blog['image']); $tags = htmlspecialchars($blog['tags']); $description = htmlspecialchars($blog['description']); } else { echo ""; exit(); } } else { echo ""; exit(); } ?>
Add New Blog
Current Image
0) { $row = mysqli_fetch_assoc($result); $current_image_name = $row['image']; $current_image_file = $target_dir . $current_image_name; // Update the blog record with new image and status $update_query = "UPDATE blogs SET title='$title', image='$new_file_name', tags='$tags', description='$description', status='$status' WHERE id='$blog_id'"; if (mysqli_query($conn, $update_query)) { // Delete the old image file if it exists if (file_exists($current_image_file)) { unlink($current_image_file); } echo ""; } else { echo ""; } } else { echo ""; } } else { echo ""; } } else { // Update the blog record without changing the image $update_query = "UPDATE blogs SET title='$title', tags='$tags', description='$description', status='$status' WHERE id='$blog_id'"; if (mysqli_query($conn, $update_query)) { echo ""; } else { echo ""; } } mysqli_close($conn); } ?>