Hi everybody,
I'm new to PHP, MySQL, and Apache. I have one beginner book on it, and I'm trying to make a page that lists the titles of my my movies, so that I can select a title, push a "submit" button and have it deleted from the table. So far this is what I have and I'm hoping that someone can point me in the right direction for materials I can reference to solve this problem.
<?
$db_name = "my_movies";
$table_name = "my_movies";
$connection = @mysql_connect("localhost", "xxxx", "xxxx")
or die(mysql_error());
$db = @mysql_select_db($db_name, $connection) or die(mysql_error());
$sql = "SELECT title FROM $table_name ORDER BY title";
$result = @($sql,$connection) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$title = stripslashes($row['title']);
$display_block .= "<P><strong>$title</strong></P>";
}
?>
<HTML>
<HEAD>
<TITLE>Delete a Record</TITLE>
</HEAD>
<BODY>
<H1>Deleting a Record from <? echo "$table_name"; ?></H1>
<FORM METHOD="POST" ACTION="do_deletemovie.php">
<P>Select a record to be deleted</P><BR>
<? echo "$display_block"; ?>
<P><INPUT TYPE="SUBMIT" NAME="submit" VALUE="Delete Record"></P>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Right now all this does is list the titles. Thanks so much for your help
scourtwright