PHP Classes

I Got Error

Recommend this page to a friend!

      Multisources Search Engine  >  All threads  >  I Got Error  >  (Un) Subscribe thread alerts  
Subject:I Got Error
Summary:I Got Error When Running index.php
Messages:2
Author:danidani
Date:2014-11-06 02:42:51
 

  1. I Got Error   Reply   Report abuse  
Picture of danidani danidani - 2014-11-06 02:42:51
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1049] Unknown database 'searchdb'' in D:\xampp\htdocs\searchfile\SearchCore\Search.class.php:91 Stack trace: #0 D:\xampp\htdocs\searchfile\SearchCore\Search.class.php(91): PDO->__construct('mysql:host=loca...', 'root', '') #1 D:\xampp\htdocs\searchfile\SearchCore\Search.class.php(59): Search::getDBConnection() #2 D:\xampp\htdocs\searchfile\index.php(5): Search::getDBSearch('rome') #3 {main} thrown in D:\xampp\htdocs\searchfile\SearchCore\Search.class.php on line 91

  2. Re: I Got Error   Reply   Report abuse  
Picture of Ettore Moretti Ettore Moretti - 2014-11-06 10:27:59 - In reply to message 1 from danidani
Hello, catching the error is due to the lack of db "searchdb."
The class can implement a search engine, drawing on data from several sources, these sources can be configured through the file "SearchConfig.php", then you should edit this file to suit your needs.
As you can see in the index.php file search examples are commented:
$ out = Search :: getDBSearch (preg_replace ("/ [^ 0-9a-z] /", "", $ _ POST ['SearchKey']));
         // $ out = Search :: getXMLSearch (preg_replace ("/ [^ 0-9a-zA-Z] /", "", $ _ POST ['SearchKey']));
         // $ out = Search :: getINISearch (preg_replace ("/ [^ 0-9a-z] /", "", $ _ POST ['SearchKey']));
         // $ out = Search :: getFLATSearch (preg_replace ("/ [^ 0-9a-z] /", "", $ _ POST ['SearchKey']));

After editing the configuration file using the static method of the class Search you are interested.

I hope I have answered your questions, if not let me know.
Regards Hector Moretti