hello all.
I have just started working with php language and am doing a website for french history. I would like to make a search engine where someone writes a word inside and then the program looks in a table in mysql and returns the results. For example if someone writes eiffel tower in the search the result will be a new page with the history of the eiffel tower.I know how to work in mysql and how to connect the php with mysql.What am asking is if someone knows a site with tutorials about search engines or something.Any help will be appreciated
Thank you
create a search engine
Moderator: General Moderators
-
Darkzaelus
- Forum Commoner
- Posts: 94
- Joined: Tue Sep 09, 2008 7:02 am
Re: create a search engine
How long do you have for this?
Search engines are very advanced applications, not what you need when starting the language.
Cheers,
Darkzaelus
Search engines are very advanced applications, not what you need when starting the language.
Cheers,
Darkzaelus
Re: create a search engine
well my project is due untill 15 of may. But i am willing to spend hours to learn it i have much time to spend on it.Any suggestions?
Re: create a search engine
Just use LIKE, or MATCH...AGAINST with a full text index. There's no need to write the engine yourself.
Re: create a search engine
these are SQL commands.onion2k wrote:Just use LIKE, or MATCH...AGAINST with a full text index. There's no need to write the engine yourself.
Heres a tutorial :
http://www.designplace.org/scripts.php?page=1&c_id=25
Re: create a search engine
Just read on the following functions:
http://www.php.net/mysql_connect
http://www.php.net/mysql_select_db
http://www.php.net/mysql_query
http://www.php.net/mysql_fetch_assoc or mysql_fetch_object or mysql_fetch_row
Once you have connected to the database you can write a query like:
http://www.php.net/mysql_connect
http://www.php.net/mysql_select_db
http://www.php.net/mysql_query
http://www.php.net/mysql_fetch_assoc or mysql_fetch_object or mysql_fetch_row
Once you have connected to the database you can write a query like:
Code: Select all
$search_string = "effeil tower"; //or whatever the user entered
$str_query = "SELECT * FROM `table_you_want_to_query` WHERE `field_you_want_to_search` LIKE '%".$search_string."%'";
$result = mysql_query($str_query);
//process result here
Re: create a search engine
thank you guys for the help. I will work on it now.