Tengo este código:
Código PHP:
<?
$connection = mysql_connect("localhost", "BD", "pass");
if ($_POST['Submit']) {
mysql_select_db("addons", $connection);
$sql = "DELETE FROM series WHERE name='".$_POST['name']."'";
$result = mysql_query($sql);
if($result) {
echo "<h3>Información borrada.</h3><br />";
}else {
echo "<h3>No se pudo borrar la serie</h3>\n";
echo mysql_error();
}
a
}
?>
<div align="center"> <h1>Borrar un banner serie</h1> <br>
<form method="post" action="<?php echo $PHP_SELF?>">
<label>
<select name="name" id="name">
<?php
mysql_select_db("addons", $connection);
$query_listserie = "SELECT * FROM series ORDER BY name ASC";
$listserie = mysql_query($query_listserie, $connection) or die(mysql_error());
$row_listserie = mysql_fetch_assoc($listserie);
$totalRows_listserie = mysql_num_rows($listserie);
do { ?>
<option value="<?php echo $row_listserie['ID']?>"><?php echo $row_listserie['name']?></option>
<?php
} while ($row_listserie = mysql_fetch_assoc($listserie));
$rows = mysql_num_rows($listserie);
if($rows > 0) {
mysql_data_seek($listserie, 0);
$row_listserie = mysql_fetch_assoc($listserie);
}
mysql_free_result($listserie);
?>
</select>
</label>
<br><br />
<INPUT TYPE="SUBMIT" value="Borrar" name="Borrar"> </FORM> </div>