I don't think you should try to do edit in the same page. Editing a record is so different it deserves its own page. So I would change
or something along those lines.
Delete, though, is easy:
I don't use PHP, but something like this:
<?php // movielibrary.php
$deleteWhich = $_GET["delete"];
if ( isset($deleteWhich ) )
$sql = "DELETE FROM library WHERE id = " . ( (int) $deleteWhich );
mysql_query( $sql ) or die( mysql_error() );
... rest of page same ...