//Verifica credenciales del usuario
include_once "include/ch.....php";
//Se conecta a base de datos
include_once "include/conn.....php";
$id_cable = $_POST['id_cable'];
$id_admin = $_POST['id_admin'];
$id_tipo_enlace = $_POST['id_tipo_enlace'];
/*Elimina los registros de la base de datos*/
if
(isset
($_POST['submit']){
if($id_admin > 0){
mysql_query="DELETE FROM administracion WHERE id_admin = $id_admin";
}
elseif($id_tipo_enlace > 0){
mysql_query="DELETE FROM tipo_enlace WHERE id_tipo_enlace = $id_tipo_enlace";
}
elseif{
mysql_query("DELETE FROM cable WHERE id_cable = $id_cable");
}
}
/*Call the three select from the DB*/
.....................
if($tableName == 'administration'){
mysql_query="DELETE FROM administracion WHERE id_admin = $id";
$recordDelete = TRUE;
}
elseif(tableName == 'tipo_enlace'){
mysql_query="DELETE FROM tipo_enlace WHERE id_tipo_enlace = $id";
$recordDelete = TRUE;
}
elseif($tableName == 'cable'){
mysql_query("DELETE FROM cable WHERE id_cable = $id";
$recordDelete = TRUE;
}
else{
print "You must select a valid table to delete. Please try again.";
}
}
else{
print "You must select a valid table and id to delete. Please try again.";
}
}
?>
The record was deleted. }?>
action="=$_SERVER['SCRIPT_FI...
method="POST">
Delete From Table:
Administration
Tipo Enlace
Cable
Record Id:
if thats what your looking to do heres a quick fix - one thing I rushed through on the first is the last elseif you originally got
// 'SCRIPT_FI... should be 'SCRIPT_FILENAME']?>"
2007-08-03 08:20:17
·
answer #1
·
answered by Big D4
·
0⤊1⤋
Get rid of at the top.
include_once should look like this:
include_once("stuff");
The if(isset($_POST['submit']){
Needs to look like this
if(isset($_POST['submit'])){
all mysql_query must look like this:
mysql_query("stuff");
(optional:)elseif's can look like this:
else if
for the form you need to put it in an echo like so:
echo '
inside that echo
You're missing an ending > on the last
I recommend reading this tutorial: http://w3schools.com
It's very helpful for learning php. :)