mysqli - how to create a search bar input to search every columns of the table using php -


i creating search bar search query every column of database table , prompt output doing php , mysqli dont have idea how show output. can me here code

if(!$db) {     require("includes/db.php")     echo 'error: not connect database.'; } else {     if(isset($_post['querystring'])) {         $querystring = $db->real_escape_string($_post['querystring']);         if(strlen($querystring) >0) {             $query = $db->query("select * mdb  name '%" . $querystring . "%' or grno '%". $querystring ."%'                                     or `address` '%". $querystring ."%', `city` '%". $querystring ."%' or pin '%". $querystring ."%'                                     or mobile '%". $querystring ."%' or `email` like'%". $querystring ."%'  order vouchno limit 8");               if($query) {                 $catid = 0;                 while ($result = $query ->fetch_object()) {                     //no idea how show result here                 } 

just answer question heres code

if(!$db) { require("includes/db.php") echo 'error: not connect database.'; } else { if(isset($_post['querystring'])) {     $querystring = $db->real_escape_string($_post['querystring']);     if(strlen($querystring) >0) {         $query = $db->query("select * mdb  name '%" . $querystring . "%' or grno '%". $querystring ."%'                                 or `address` '%". $querystring ."%', `city` '%". $querystring ."%' or pin '%". $querystring ."%'                                 or mobile '%". $querystring ."%' or `email` like'%". $querystring ."%'  order vouchno limit 8");           if($query) {             $catid = 0;             $results = array();             while ($result = $query ->fetch_object()) {                 //no idea how show result here                 $results[] = $result;             }              /* use $results show result using foreach or forloop*/ 

but please consider comments above.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -