Advertisement
XenRevo

Revo

Aug 27th, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.27 KB | None | 0 0
  1. <?php
  2.     mysql_connect("localhost", "user", "passwordremoved") or die("Error connecting to database: ".mysql_error());
  3.      
  4.     mysql_select_db("GAL") or die(mysql_error());
  5.    
  6. ?>
  7.  
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  9. <html xmlns="http://www.w3.org/1999/xhtml">
  10. <head>
  11.     <title>Search results</title>
  12.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  13.     <link rel="stylesheet" type="text/css" href="style.css"/>
  14. </head>
  15. <body>
  16. <?php
  17.     $query = $_GET['query'];
  18.    
  19.      
  20.      ini_set('display_errors',1);  
  21.      error_reporting(E_ALL);
  22.          
  23.          
  24.         $query = mysql_real_escape_string($query);
  25.    
  26.          
  27.         $raw_results = mysql_query("SELECT * FROM GALTotals
  28.            WHERE (`IGN` LIKE '%".$query."%') ") or die(mysql_error());
  29.              
  30.  
  31.          
  32.         if(mysql_num_rows($raw_results) > 0){
  33.              
  34.             while($results = mysql_fetch_array($raw_results)){
  35.          
  36.              
  37.                 echo "<p><h3>".$results['IGN']."</h3></p>";
  38.                
  39.             }
  40.              
  41.         }
  42.         else{
  43.             echo "No results";
  44.         }
  45.          
  46.     }
  47. ?>
  48. </body>
  49. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement