Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/10/2007, 11:10
oldwolf200x
 
Fecha de Ingreso: octubre-2007
Mensajes: 2
Antigüedad: 16 años, 6 meses
Puntos: 0
Exclamación Re: Alguien me puede explicar...

de antemano gracias,
en efecto el phpmyadmin me permite manipular las bd, pero yo necesito poder manipularlas desde mi codigo que es en php (alguien me entendiio ¿?), es decir usar sentencias sql como update (que es la que me esta dando problemillas), y existen algunas cosas que son sencillas pero el ser demasiado dummie no me hace entendermuy bien,


<?php if (isset($_POST["modificar"])){

$modificar=$_POST["modificar"];
$resultmodificar=mysql_query("UPDATE agenda set email='$email' where modificar=$modificar") or die ("error".mysql_error());


/*if(isset($_POST["guardarModificar"])){
$idModificar = $_POST["idModificar"];
$resultGuardarModificar = mysql_query("UPDATE tabla SET campo='$campo' WHERE id=$idModificar") or die ("ERROR");*/




/*update $sql = "UPDATE agenda SET nombre='$nombre', direccion='$direccion', ";

$sql .= "telefono='$telefono', email='$email' WHERE id=$id";

$result = mysql_query($sql);*/

}?>
<html>
<head>
<title>Modificar Registro</title>
</head>
<body>
<?php
$email=$_POST["mail"];


$link=mysql_connect("localhost","root","") or die("Problemas en la conexion".mysql_error());

mysql_select_db("prueba",$link) or die("Problemas en la selección de la base de datos".mysql_error());


$registros=mysql_query("select * from agenda where email='$email'",$link) or die("Problemas en el select:".mysql_error());

if ($reg=mysql_fetch_array($registros))
{

?>
<form action="modificarregistro01falta.php" method="post">
Ingrese nuevo mail:
<input type="text" name="mailnuevo" value="<?php echo $reg['$email'] ?>">
<br>
<input type="hidden" name="mailviejo" value="<?php echo $reg['$email'] ?>">
<input name="modificar" type="submit" id="modificar" value="Modificar">
</form>
<?php
}
else
echo "No existe alumno con dicho mail";
?>
</body>
</html>

he alli el codigo me manda un error que es el siguiente

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\WEB\Inventario\paginas\inventarios\Pruebas Iniciales\modificarregistro01falta.php on line 4

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\WEB\Inventario\paginas\inventarios\Pruebas Iniciales\modificarregistro01falta.php on line 4
errorAccess denied for user 'ODBC'@'localhost' (using password: NO)



no he tenido muchas ayuda, en la web encuentro pero al adaptarlo a lo que deseo no me funciona muy bien, chispas, empiezo a sentirme algo fatigado por no progresar pero me doy animos para no abandonar, se que lo lograre, doy gracias por la ayuda del tutorial de el estoy aprendiendo, eso me agrada.