Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: PHP  |  size: 0.63 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function SearchPeople()
  2.         {
  3.                 $pattern = $_POST['Pattern'];
  4.                
  5.                 if(empty($_POST['Pattern']))
  6.         {
  7.             $this->HandleError("Please input keyword!");
  8.             $this->RedirectToURL("buzzer.php");
  9.         }
  10.                 else    // valid input pattern
  11.                 {*/
  12.                         // find any user whose handle contains pattern
  13.                         $sql_pattern = "SELECT userID FROM users WHERE handle LIKE '%$pattern%'";
  14.                        
  15.                         $database_id = connectdb_read();
  16.                         $results = mysql_query($sql_pattern);
  17.                         mysql_close($database_id);
  18.                        
  19.                         if(!$results)
  20.                         {
  21.                                 // find people failed
  22.                                 error("Cannot found people!");
  23.                                 return;
  24.                         }
  25.  
  26.                         return $results;
  27.                 }
  28.         }