Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2.  
  3. $host = "127.0.0.1";
  4. $user = "root";
  5. $password = "";
  6.  
  7. $conectar = mysql_connect ($host, $user, $password);
  8. mysql_select_db("proyectofinallp4", $conectar);
  9.  
  10. $id = $_POST["id"];
  11. $nombre = $_POST["nombre"];
  12. $password = $_POST["password"];
  13.  
  14.  
  15. $consulta = "INSERT INTO usuarios id = '$id', nombre = '$nombre', password = '$password'";
  16. $query = mysql_query ($consulta, $conectar);
  17. $resultado = mysql_fetch_row ($query); //ESTA ES LA LINEA 61
  18.  
  19.  
  20. if ($query == null) {
  21. echo "<center><h1>ERROR AL REGISTRAR</h1></center>" . mysql_error();
  22. }
  23. else
  24. {
  25. echo "<center><h1>USUARIO REGISTRADO EXITOSAMENTE</h1></center>";
  26. }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement