Advertisement
Guest User

Untitled

a guest
May 19th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. <?php
  2. $mysql_host = "mysql10.000webhost.com";
  3. $mysql_database = "a3148355_datos";
  4. $mysql_user = "a3148355_datos";
  5. $mysql_password = "wilson083";
  6. $nombre = $_POST['nombre'];
  7. $nombre = mysql_escape($nombre)
  8. $sql = "INSERT INTO tabla(nombre) VALUES(".$nombre.")"
  9. $query = mysql_query($sql);
  10. switch($query){
  11.     case true:
  12.         echo "Datos guardados";
  13.     break;
  14.     case false:
  15.         echo "Ocurrio un error";
  16.     break;
  17. }
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement