Ver Mensaje Individual
  #6 (permalink)  
Antiguo 23/02/2009, 16:54
richardmafia
 
Fecha de Ingreso: diciembre-2008
Mensajes: 75
Antigüedad: 15 años, 5 meses
Puntos: 1
Respuesta: problemas con mysql_query

es entero pero coloco variables para que vean el problema por ustedes mismos les voy escribir el codigo

conect.php
<?php function Conectarse()
{
if (!($link=mysql_connect("localhost","pecesama","pru ebas")))
{
exit();
}
if (!mysql_select_db("basedatos",$link))
{
exit();
}
return $link;
} ?>

eliminareg.php
<html>
<head>
<title>Ejemplo de PHP</title>
</head>
<body>
<H1>Ejemplo de uso de bases de datos con PHP y MySQL</H1>
<?php
include("conec.php");
$link=Conectarse();
$result=mysql_query("select * from topo",$link);
?>
<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1>
<TR>
<TD>&nbsp;Nombre</TD>
<TD>&nbsp;Dirección&nbsp;</TD>
<TD>&nbsp;Telefono&nbsp;</TD>
<TD>&nbsp;Email&nbsp;</TD>
<TD>&nbsp;Imagen&nbsp;</TD>
<TD>&nbsp;Borra&nbsp;</TD>
</TR>
<?php
while($row = mysql_fetch_array($result)) {
printf("<tr><td>&nbsp;%s</td><td>&nbsp;%s&nbsp;</td><td>&nbsp
;%s&nbsp;</td><td>&nbsp;%s&nbsp;</td><td>&nbsp;%s&nbsp;</td><
/td><td><a href=\"borra.php?id=%d\">Borra</a></td></tr>",
$row["nombre"],$row["direccion"],$row["telefono"],$row["email
"],$row["imagen"],$row["ID"]);
}
mysql_free_result($result);
?>
</table>
</body>
</html>

borra.php
<?php
include("conec.php");
$link=Conectarse();
mysql_query("delete from tablacurso where ID = $id",$link);
header("Location: eliminareg.php");
?>

ya lo ven pero no funciona no se que esta mal tal ves encuentren el error gracias