SHARE
TWEET

Untitled

a guest Oct 17th, 2017 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $db_hostname = 'localhost';
  3. $db_username = 'root';
  4. $db_password = '';
  5. $db_database = 'limiti';
  6.  
  7. // Database Connection String
  8. $con = mysql_connect($db_hostname,$db_username,$db_password);
  9. if (!$con)
  10.   {
  11.   die('Fel: ' . mysql_error());
  12.   }
  13.  
  14. mysql_select_db($db_database, $con);
  15. ?>
  16.  
  17.  
  18.     <head>
  19.         <meta charset="utf-8" />
  20.         <title></title>
  21.     </head>
  22.     <body>
  23. <form action="" method="post">  
  24. Sök: <input type="text" name="term" /><br />  
  25. <input type="submit" value="Submit" />  
  26. </form>  
  27.  
  28.  
  29.  
  30. <?php
  31. if (!empty($_REQUEST['term'])) {
  32.  
  33. $term = mysql_real_escape_string($_REQUEST['term']);    
  34.  
  35. $sql = "SELECT * FROM limited WHERE serie_nr LIKE '%".$term."%'";
  36. $r_query = mysql_query($sql);
  37. while ($row = mysql_fetch_array($r_query)){  
  38. echo '<br /> Namn: ' .$row['namn'];  
  39. echo '<br /> SerieNummer: '.$row['serie_nr'];  
  40. echo '<br /> Nummer: '.$row['nummer'];  
  41. }  
  42.      
  43. }      
  44. ?>
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top