function delete_mrm_band($id) { $mrm_band = get_mrm_band($id); $update = "DELETE FROM mrm_bands where id=" . $id; $result = mysql_query($update); if (!$result) { echo "'Error deleting the modern rock band from the database: " . $update . "<br>"; } else { echo "<div class=\"center\"><h1>Success!</h1>" . "<h3>The band <span class=\"success\">" . $mrm_band['name'] . "</span> has been deleted.</h3></div>"; } }
require "partials/_mrm_band_form.php"; echo "</form>\n <div class=\"footnote\">** if any links are over 128 characters: use <a href=\"http://www.bit.ly\" target=_new>bit.ly</a> to shorten the url</div>"; } else { $name = $_POST['name']; $url = $_POST['url']; $pic_url = $_POST['pic_url']; $placement = $_POST['placement']; $seed = $_POST['seed']; $abbr = $_POST['abbr']; if (!$name || !$url || !$pic_url || !$placement || !$seed || !$abbr) { echo '<div class="top-spacer_20 center error">Error - missing required value(s)</div>'; } else { $result = update_mrm_band($id, $name, $url, $pic_url, $placement, $seed, $abbr); if ($result) { echo '<div class="top-spacer_20 center"><h1>Update was successful!</h1>'; display_mrm_band(get_mrm_band($id)); echo "</div>"; } } } ?> <div class="top-spacer_20"> <a href="mrm_view_all.php">View all Modern Rock Madness Bands</a> <p> <a href="cp.php">Control Panel</a> </div> </div> </div> <!-- end of row div --> <?php } require "partials/_footer.php";