ciao,
ho questo codice che serve, in un pannello per la gestione di immagini, ad eliminare un immagine selezionata.
Il problema è che se elimino un immagine, mi vengono eliminate entrambe e non solo quella selezionata.
come posso risolvere questo problema?
codice:
Codice PHP:
function deleteImage()
{
if (isset($_GET['productId']) && (int)$_GET['productId'] > 0) {
$productId = (int)$_GET['productId'];
} else {
header('Location: index.php');
}
$deleted = _deleteImage($productId);
// update the image and thumbnail name in the database ITALIANO
$sql = "UPDATE tbl_project
SET prj_image = '', prj_thumbnail = ''
WHERE prj_id = $productId";
dbQuery($sql)or die(mysql_error());
$deleted_fr = _deleteImage_fr($productId);
// update the image and thumbnail name in the database FRANCESE
$sql_fr = "UPDATE tbl_project_fr
SET prj_image_fr = '', prj_thumbnail_fr = ''
WHERE prj_id = $productId";
dbQuery($sql_fr)or die(mysql_error());
header("Location: index.php?view=modify&productId=$productId");
}
grazie