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
Code:
<a href='movielibrary.php?edit=$row[0]'>Edit</a>
to
Code:
<a href='movieedit.php?id=$row[0]'>Edit</a>
or something along those lines.
Delete, though, is easy:
I don't use PHP, but something like this:
Code:
<?php // movielibrary.php
require_once 'login.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 ...