hi, i have a problem with a DELETE query that does not works.
i have a page in php where appears a table with some info ex. id,program name,details and the link to download the program.
in that same page there is a little form where i enter the program id and click on the submit button where the id is sent to another php page where validates and runs the delete query. my problem is that there is no error but the query does not delete the program row with the correspond id. this is the php page where should delete the row according to the entered id in the previous page:
i have a page in php where appears a table with some info ex. id,program name,details and the link to download the program.
in that same page there is a little form where i enter the program id and click on the submit button where the id is sent to another php page where validates and runs the delete query. my problem is that there is no error but the query does not delete the program row with the correspond id. this is the php page where should delete the row according to the entered id in the previous page:
Code:
<?php include("funciones.php"); conectar(); $idprog = $_POST["idprog"]; $sqlquery1 = "SELECT * FROM programas WHERE idprog = '".$idprog."' "; $query1 = mysql_query($sqlquery1) or die ("El query no se ejecuto. <a href=adminaction.php>Regresar</a>"); if (!empty($query1)) { $sqlquery2 = "DELETE FROM programas WHERE idprog = '".$idprog."' "; header("Location: adminaction.php"); } else { die("No hubo resultados. <a href=adminaction.php>Regresar<a/>"); } ?>
Comment