PHP Classes

Search

Recommend this page to a friend!

      AED  >  All threads  >  Search  >  (Un) Subscribe thread alerts  
Subject:Search
Summary:search
Messages:3
Author:Stefan Drugda
Date:2015-11-12 15:02:01
 

 


  1. Search   Reply   Report abuse  
Picture of Stefan Drugda Stefan Drugda - 2015-11-12 15:02:01
edit, add, del .... search?
may be there also?
Example: Search in "Username / Password / Email" word "capital"

--> public function search($search_word, $col_name1,$col_name2,$col_name3..)

  2. Re: Search   Reply   Report abuse  
Picture of Vishv Sahdev Vishv Sahdev - 2015-11-15 12:48:47 - In reply to message 1 from Stefan Drugda
public function search($search, $col, $table) {

$col = explode(",",$col);
foreach($col as $k=>$v)
{
isset($vals) ? $vals .= ' OR ' : $vals = '';
$vals .= "$v like '%$search%' ";
}
}
$this->query_id = $this->query("SELECT * FROM $table WHERE ".$vals);
if (!$this->query_id)
return false;
else
return $this->query_id ;
}

  3. Re: Search   Reply   Report abuse  
Picture of Stefan Drugda Stefan Drugda - 2015-11-16 06:52:38 - In reply to message 2 from Vishv Sahdev
not works...
Do you do not any tests?
..it's a syntax error