1
Hello, I'm developing a module, but I have a problem, when I try to delete a record from certain table, my script doesn't delete the item, all the others work well: redirect and don't and it does not appear message of error.
The script is the next:
Quote:
<?php
require_once('../../../mainfile.php');
include_once(XOOPS_ROOT_PATH."/class/xoopsmodule.php");
include(XOOPS_ROOT_PATH."/include/cp_functions.php");
if ( $xoopsUser ) {
$xoopsModule = XoopsModule::getByDirname("cartelera");
if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
redirect_header(XOOPS_URL."/",3,_NOPERM);
exit();
}
} else {
redirect_header(XOOPS_URL."/",3,_NOPERM);
exit();
}
xoops_cp_header();
//Code to delete the item
$sql = sprintf("DELETE FROM %s WHERE id_horario = %s", $xoopsDB->prefix("cartelera_cat"), $_GET['horario']);
$xoopsDB->query($sql);
redirect_header("horarios.php",2,"Item deleted");
//Include the page footer
xoops_cp_footer();
?>
Please tell me where is my error, or what's bad??