Mi scrip no funciona
Publicado por mirbida (8 intervenciones) el 09/06/2005 14:16:25
Tengo problemas con un scrip, nose porque pero no hace la modificacion que quiero, le coloque valores fijo a las variables para probar pero aun asi no lo ejecuta ayudenme por favor!!! tengo uno parecido que si funciona pero no entiendorque este no!
<html>
<body>
<?php
$cod=2;
$rif="HHH-9956";
$nit=678900-88;
$nombre="UNEG";
$margen="nacional";
$link = mysql_connect("localhost", "mysql");
mysql_select_db("consultoria",$link);
$sql = "SELECT * FROM instituciones WHERE id_inst = $cod";
echo "$result = mysql_query($sql);";
$sql = "UPDATE agenda SET rif='$rif',
nit='$nit', nom_ins='$nombre', margen_ins='$margen'";
echo "$result = mysql_query($sql);";
if (mysql_query($sql, $link)){
echo "El Registo fue moficiado";
}
mysql_close($link);
?>
</body>
</html>
<html>
<body>
<?php
$cod=2;
$rif="HHH-9956";
$nit=678900-88;
$nombre="UNEG";
$margen="nacional";
$link = mysql_connect("localhost", "mysql");
mysql_select_db("consultoria",$link);
$sql = "SELECT * FROM instituciones WHERE id_inst = $cod";
echo "$result = mysql_query($sql);";
$sql = "UPDATE agenda SET rif='$rif',
nit='$nit', nom_ins='$nombre', margen_ins='$margen'";
echo "$result = mysql_query($sql);";
if (mysql_query($sql, $link)){
echo "El Registo fue moficiado";
}
mysql_close($link);
?>
</body>
</html>
Valora esta pregunta


0