Skip to content

Instantly share code, notes, and snippets.

Created July 25, 2014 22:55
Show Gist options
  • Save anonymous/1dd3d7cdd54de65b44c1 to your computer and use it in GitHub Desktop.
Save anonymous/1dd3d7cdd54de65b44c1 to your computer and use it in GitHub Desktop.
This leads to an error
<?php
require_once '../include/conectar.php';
if (isset($_POST['borrar_id']) && is_array($_POST['borrar_id']))
{
foreach ($_POST['borrar_id'] as $id)
{
$result_filename = $db->query("SELECT `direccion` FROM `imagenes` WHERE `id`='{$id}'");
while ($result_filename->fetch_array())
{
unlink($result_filename);
echo $result_filename;
}
$db->query("DELETE FROM `imagenes` WHERE `id`='{$id}'");
//header ('Location: borrar.php');
}
}
//header ('Location: borrar.php');
else
{
//header ('Location: borrar.php');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment