SHARE
TWEET

Untitled

a guest Aug 14th, 2016 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $servername = "localhost";
  2.     $username = "root";
  3.     $password = "";
  4.     $dbname = "proyecto_terror";
  5.  
  6.     $conn = mysqli_connect($servername, $username, $password, $dbname);
  7.     mysql_select_db("proyecto_terror");
  8.  
  9. Y Aquí tengo el resto del código que es donde hago mi select y mi update para que se actualice en la fila que yo deseo
  10.  
  11. $nick2 = $_GET["nickP"];
  12. $sql = "SELECT * FROM usuario WHERE nick = '".$nick2."'";
  13. $result = mysqli_query($conn, $sql) or die(mysqli_error($conn));
  14. $datos = array();
  15. if (mysqli_num_rows($result) > 0) {
  16.     while ($row = mysqli_fetch_assoc($result)) {
  17.         $datos[] = $row;
  18. $passA=$_POST["passA"];
  19. $passR=$_POST["passR"];
  20.  
  21.  
  22.  
  23. if ($row["password"]==$passA) {
  24. mysql_query("UPDATE usuario SET password = '$passR' WHERE id_usuario = '$row[id_usuario]'");
  25. echo mysql_error();
  26. }else {
  27.     echo "no coinciden";
  28. }
  29.  
  30.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top