Guest User

Untitled

a guest
Oct 30th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. PHP Part:(Save as search.php or save it in the look up users file)
  2. <?php
  3. $db_host = 'localhost';
  4. $db_user = 'root';
  5. $db_pass = 'password';
  6. $db_name = 'Database Name';
  7. $db_tabl = 'Database Table Name';
  8. $db_colu = 'Database Column name like users, ect..';
  9.  
  10. mysql_connect("$db_host", "$db_user", "$db_pass");
  11. mysql_select_db("$db_name");
  12.  
  13. $query = mysql_real_escape_string($_GET['query']);
  14. $query_result = mysql_query("SELECT * FROM $db_tabl WHERE $db_colu like '%".$query."%'");
  15.  
  16. while($data_fetch = mysql_fetch_array($query_result))
  17. {
  18. echo "<p>";
  19. echo $data_fetch['table_attribute'];
  20. echo "<p>";
  21. }
  22. mysql_close();
  23. ?>
  24.  
  25. HTML part:(Save it as search.htm)
Add Comment
Please, Sign In to add comment