hola.....
Hice este formulario personal para poder borrar datos de mi bd
Código:
<td height="100" align="center" bordercolor="#999999" bgcolor="#FFFF99">
<form>
<table width="99%" height="69" bordercolor="#FFFF99" border="1">
<tr>
<td width="50%" align="center" bordercolor="#999999">Categoria
<select name="bor" method="post" action="<?php echo $PHP_SELF ?>">
<option selected>Vehiculos</option>
<option>Animales</option>
<option>Hogar</option>
<option>Inmuebles - venta</option>
<option>Inmuebles - alquiler</option>
<option>Maquinaria</option>
<option>Mobiliario</option>
<option>Tecnologia</option>
<option>Varios</option>
<option>Empleos</option>
<option>Servicios</option>
<option>pruebas</option>
</select>
</td>
<td width="50%" align="center" bordercolor="#999999">Id number
<input type="text" name="num">
</td>
<tr>
</tr>
</table>
<table width="94%" height="38" border="1" bordercolor="#FFFF99">
<tr>
<td width="29%" height="34" align="center"><input type="submit" name="Submit" value="Borrar"></td>
<td width="71%" align="center" bordercolor="#999999">
Código PHP:
<?php
if ($num==""){
echo "Escriba el id que desea borrar";
} else {
mysql_connect("localhost", "", "") or die (mysql_error());
mysql_select_db ("") or die (mysql_error());
$borrar="DELETE from $bor WHERE id= $num";
mysql_query($borrar) or die(mysql_error());
echo "se borro el siguiente id en $bor: $num";
}
?>
</td>
</tr>
</table>
</form></td>
todo me funciona bien.....si me borra todo lo que haya en ese id,
pero cuando entro a phpmyadmin y me voy a la tabla, me dice que esta overhead en rojo....entonces le apacho donde dice optimizar tabla y me lo arregla pero necesito saber como hacer para que esto no pase.....
gracias de antemano....
sicuesn