PDA

View Full Version : Searching a MySQL database using PHP


badben
5th July 2006, 19:20
Does anybody out there know a tutorial or good script to search a MySQL database for keywords using PHP?

Ben

falko
6th July 2006, 13:51
There are a few ;) PHP-MySQL tutorials here: http://www.google.com/search?q=php+mysql+tutorial&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official


I haven't tried them, but they should get you started.
http://www.freewebmasterhelp.com/tutorials/phpmysql
http://www.webmonkey.com/webmonkey/programming/php/tutorials/tutorial4.html

Destroyer
26th July 2006, 05:12
I am not sure if you want to search one table or the whole db but here are some links that may help

http://www.devarticles.com/c/a/MySQL/Getting-Started-With-MySQLs-Full-Text-Search-Capabilities/

http://www.tizag.com/mysqlTutorial/mysqlselect.php

AaronDavison
20th February 2009, 08:56
Hi:cool:

:p Wonderful info guys....The list of apps looks great.....and i thank u..:)


edit reason.
Links look like spam.
Sorry if I'm wrong.

Angelito
21st February 2009, 22:10
SELECT * FROM `PRODUCT`
WHERE Enabled=1 AND
(name LIKE '%".$_GET["searchstring"]."%' OR description LIKE '%".$_GET["searchstring"]."%' OR brief_description LIKE '%".$_GET["searchstring"]."%');

It should return any record with a matching string in either specified field.

Share your results if it works for you.

Angel

hardy123
20th March 2009, 10:25
http://www.tizag.com/mysqlTutorial/-It will surely help you.