Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Er. Rochak Chauhan  >  PHP Search MySQL Tables  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example Script
Class: PHP Search MySQL Tables
Search for text in all tables of a MySQL database
Author: By
Last change:
Date: 2010-05-02 06:30
Size: 631 bytes
 

Contents

Class file image Download
<?php
define
("SERVERNAME","localhost");
define("USERNAME","root");
define("PASSWORD","password");

require(
"PhpSearchMysqlTables.inc.php");

$searchFromDatabase=array("bluemobile","mobiles");
$object=new PhpSearchMysqlTables($searchFromDatabase);  //Enter no parameter to search from the entire database

$keyword="nokia";
$matchWord=false;             //optional
$caseSenstive=false;        //optional

$result=$object->getSearchResults($keyword,$matchWord,$caseSenstive);
$count=count($result);
if(
$count==0){
    echo 
"Sorry $keyword was not found in any of the table";
}
else{
    echo 
$object->showResultAsHtml($result);
}
?>