Yo pensé... Bueno, selecciono el ultimo registro y lo muestro en DELETE, pero me sale este error:
Error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 1
Este es mi script:
Código PHP:
session_start();
if (isset($_SESSION['admin'])) {
include("../config.php");
$resp = mysql_query("SELECT * FROM radio_progra ORDER BY id DESC LIMIT 1");
$row = mysql_fetch_array($resp);
$sql = mysql_query("delete from hostimage_imagenes where id='$row[id]'") or die("Error: ".mysql_error());
$res = mysql_query($sql) or die("Error: ".mysql_error());
header("Location: index.php");
}else{
echo 'Tu no estas autentificado. No puedes entrar aqui!!<br><br><a href="index.php">Volver</a>';
}