Skip to content

Instantly share code, notes, and snippets.

@trq
Forked from anonymous/gist:1dd3d7cdd54de65b44c1
Last active August 29, 2015 14:04
Show Gist options
  • Save trq/64c2c8326118a0f8be44 to your computer and use it in GitHub Desktop.
Save trq/64c2c8326118a0f8be44 to your computer and use it in GitHub Desktop.
<?php
require_once '../include/conectar.php';
if (isset($_POST['borrar_id']) && is_array($_POST['borrar_id']))
{
foreach ($_POST['borrar_id'] as $id)
{
$result = $db->query("SELECT `direccion` FROM `imagenes` WHERE `id`='{$id}'");
while ($obj = $result->fetchObject())
{
echo $obj->direccion;
}
$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