|
|
|
Google like search engine for your site,
the $not_search_word array can be added to,
to limit the results even further for those
common words that should not be searched for.
| <?php
foreach ($searchwords as $word) {
/*
For each word, include any records that have all of the words in the field anywhere,
but the problem is, after this how to tell sql to combine all of these (if there were
several words) and then insert them into sql statement.
*/
$not_search_word = array('if', 'for', 'in', 'on','and','with'); //add words as needed
echo "Only relevant search terms are searched. They are shown in bold below.
Words like in, for etc are not searched on as they are common words
and will skew results";
echo "Search results for :";
if (!in_array($word,$not_search_word)){ //relevant search term only
echo " <b>$word</b> ";
if ($x==1){
$sql.= " fieldname like '%$word%' ";
$x++; //increase the counter
}else
$sql .= "OR fieldname like '%$word%' ";
}//close if then
}else{
echo $word;
}//end if
}//close foreach loop
//do the query
//report the results
//Have some fun with this one
//bastien
?> | |
|
|
| Point and Click Interface ala MS Access for creating SQL statements. Categories : MySQL, Complete Programs, General SQL, PHP, Databases | | | Is there some possibility to link a database to an htaccess file, so that instead of having a passwd file you would have a database with DES-crypted password and username fields? Categories : Authentication, PHP, General SQL, Databases | | | free, search engine, indexing, system, information, web,
ftp, http, free, software, cgi, php, MySQL, database, php3,
FreeBSD, Linux, Unix, UdmSearch Categories : MySQL, Complete Programs, PHP, Databases, Search | | | phpEasySQL - Easily connect to your MySQL database with just 1 php file and 3 easy steps! Categories : Databases, PHP, MySQL, General SQL | | | Logs hits to any page which includes it. Automatically utilises page access information left behind by PHP/FI2.0. Categories : Databases, PHP, mSQL, Databases | | | This function will populate the options in a drop down HTML select list
in a form from a database query.
Categories : MySQL, General SQL, PHP, HTML and PHP, Databases | | | I`d like to use the mysql_fetch_row function along with a "randomizer"
function that would give me a random result from a mySQL table. Categories : General SQL, MySQL, PHP, Databases | | | Sql Builder Categories : PHP, HTML and PHP, Databases, General SQL, Form Processing | | | This is a class with functions that are taken from simple SQL statements.
I made it to have an easier connection between PHP3 and DBase files. Categories : General SQL, PHP, PHP Classes, Databases | | | This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server. Categories : Databases, MySQL, Complete Programs, PHP, Databases | | | Dynamic WHERE CLAUSE depending on number of FORM FIELDS Categories : ODBC, General SQL, PHP, Complete Programs, Databases | | | Persistent connections - General information. Categories : General SQL, PHP, Databases | | | DirtSearch Version 3.5 full function robust PHP and MySQL (and other
databases) Site or Web Wide Search Engine
Categories : PHP, MySQL, Complete Programs, Search, Databases | | | ADODB Database Wrapper Abstraction Library for PHP: MySQL, MSSQL,
Oracle, Interbase,ODBC, Microsoft Access and FoxPro. Categories : PHP Classes, Databases, PHP, General SQL, ODBC | | | phpYellow Pages Standard Categories : PHP, Complete Programs, Databases, Directories, Search | |
|
|
|