Jump to content
xisto Community
Corey

Search Script

Recommended Posts

i need a simple script writen in PHP...that searches the MySQL database and finds the word searched in it...

 

here's an example

 

 

i search for "big"

 

 

Result:

 

big things happend.....

 

that was abig...

 

big sale on...

 

 

---------

 

so i click on one of the options and it directs me to the whole content...

 

i hope you know some script that could help me...

 

 

see ya;)

Share this post


Link to post
Share on other sites

I'll teach you not only how to implement the search script, I'll teach you how to uncover more knowlegde than you thought possible!

 

Let's see. We have to get something that uses PHP and MySQL and it has to be some sort of search script. I know, lets try Google!

We go to https://www.google.de/?gfe_rd=cr&ei=BwkjVKfAD8uH8QfckIGgCQ&gws_rd=ssl and type... oh, I don't know, what about 'php mysql "search script"'? Without the single quotes, but with the dubble quotes. Hmm. You know what, I'm feeling lucky, so I click on the "I'm feeling lucky" button. Wow! A solution!

 

Who would have thought that ten seconds using Google would have given me a solution. It's incredible!

 

 

 

Alternatively you could use something like phpDig, which I have no experience with, but am sure is quite advanced.

Share this post


Link to post
Share on other sites

TRY THIS...

$search_word = "in";

@mysql_connect($host, $user, $mysql_password);

$sql = "SELECT * FROM $table_name WHERE field_in_table LIKE '%$search_word%' ";

// LIKE, =, != you can learn in phpmyadmin when you try to search in database.

// %$search_word% the results are since, inner or win

// %$search_word the result is win :P

// $search_word% the result is inner :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.