Advertisement
Guest User

Untitled

a guest
Jun 5th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. </head>
  7. <body>
  8. <form action="" method="GET" >
  9. <input type="text" autocomplete="on" name="q" placeholder="Digite a sua pesquisa" />
  10. <input type="submit" value="Tecle Enter" />
  11. </form>
  12. <?php
  13.  
  14. $host = 'localhost';
  15. $user = 'devel';
  16. $password = '********';
  17. $database = 'Cadastro';
  18.  
  19. $connect = mysqli_connect($host, $user, $password, $database) or die("conexao die");
  20. $query = $_GET['q'];
  21.  
  22. if(isset($query)){
  23. $consult = mysqli_query("SELECT nome FROM 'usuarios' WHERE 'nome' LIKE %q%", $connect);
  24. $result = mysqli_fetch_assoc( $consult );
  25. print_r($result);
  26. }
  27.  
  28. else {
  29. echo 'nao foi encontrado nada';
  30. }
  31. ?>
  32. </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement