function delete_cdotw($id) { $update = "UPDATE cdotw SET deleted ='yes' where id=" . $id; $result = mysql_query($update); if (!$result) { echo "'Error deleting the CD of the week from the database: " . $update . "<br>"; } else { $cdotw = get_cdotw($id); echo "<div class=\"center\"><h1>Success!</h1>" . "<h3>The CD of the Week entry for <span class=\"success\">" . $cdotw['artist'] . " - " . $cdotw['title'] . "</span> has been deleted.</h3></div>"; } }
} else { $artist = $_POST['artist']; $title = $_POST['title']; $label = $_POST['label']; $review = $_POST['review']; $cd_pic_url = $_POST['cd_pic_url']; $band_url = $_POST['band_url']; $reviewer = $_POST['reviewer']; $date = $_POST['date']; if (!$artist || !$title || !$label || !$review || !$cd_pic_url || !$band_url || !$reviewer || !$date) { echo '<div class="top-spacer_20 center error">Error - missing required value(s)</div>'; } else { $result = update_cdotw($id, $artist, $title, $label, $review, $cd_pic_url, $band_url, $reviewer, $date); if ($result) { echo '<div class="top-spacer_20 center"><h1>Update was successful!</h1>'; display_cdotw(get_cdotw($id)); echo "</div>"; } } } ?> <div class="top-spacer_20"> <a href="cdotw_view_all.php">View all CD of the Weeks</a> <p> <a href="cp.php">Control Panel</a> </div> </div> </div> <!-- end of row div --> <?php } require "partials/_footer.php";