Ver Mensaje Individual
  #5 (permalink)  
Antiguo 21/10/2012, 17:22
edward_bukowski_1980
 
Fecha de Ingreso: octubre-2012
Ubicación: Caracas, Venezuela
Mensajes: 31
Antigüedad: 11 años, 6 meses
Puntos: 0
Respuesta: Borrar tablas relacionadas.

Ok amigo te entiendo pero me da dos errores, te los muestro:

Código PHP:
<?php 

$id 
$_GET['id'];  
$idg $_POST['idg'];  
//$idg = $_GET['idg'];          
//$idg = isset($_GET["idg"])? $_GET["idg"]: '';  

require ("funciones2.php");

$idc conectar();


$sql "SELECT * FROM musica WHERE idg=$idg";
//$sql="SELECT * FROM musica m, generos g  WHERE m.idg = g.idg";

$res ejecutar($sql,$idc);

$fila getRegistro ($res);
$sql "DELETE FROM musica WHERE idg=$idg"
//$sql = "DELETE generos FROM generos g, musica m WHERE g.idg = m.idg";
 
$res ejecutar($sql,$idc);

$sql "SELECT * FROM musica WHERE id=$id";

$res ejecutar($sql,$idc);

$fila getRegistro ($res);

$sql "DELETE FROM musica WHERE id=$id";

$res ejecutar($sql,$idc);


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sistema de rock</title>
<link href="formato1.css" rel="stylesheet" type="text/css" />
</head>
<body>


   <?php 
if ($res)
    echo 
"ELIMINACIÓN EXITOSA";
else
    echo 
"ERROR";
?>

 
<br/>
<br/>

</body>
</html>
<?php 
cerrar 
($idc);
?>
Notice: Undefined index: idg in C:\wamp\www\Edward-Relaciones\eliminar.php on line 4
Call Stack
# Time Memory Function Location
1 0.0032 143944 {main}( ) ..\eliminar.php:0

( ! ) Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\Edward-Relaciones\funciones2.php on line 22
Call Stack
# Time Memory Function Location
1 0.0032 143944 {main}( ) ..\eliminar.php:0
2 0.0053 155752 getRegistro( ) ..\eliminar.php:18
3 0.0053 155800 mysql_fetch_array ( ) ..\funciones2.php:22
ELIMINACIÓN EXITOSA

Y no borra el registro de la tabla generos.