Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Search facility

Explorer ,
Dec 06, 2006 Dec 06, 2006

Copy link to clipboard

Copied

Can anyone point me to an easy to understand tutorial to create a search box using certain fields from different tables in a MySql database/PHP. I am new to PHP and would like to include this on each page in my site. The database is already created and and connecting fine.

Thanks

Atchy
TOPICS
Server side applications

Views

394
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 06, 2006 Dec 06, 2006

Copy link to clipboard

Copied

Are you needing to search by multiple selections or just a keyword search?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 07, 2006 Dec 07, 2006

Copy link to clipboard

Copied

Hi Arandlett,
I am hoping to search by keywords. My current site uses seperate text boxes to search by Firstname, Surname, county and medium. I would like users to be able to key into the one text box 2 maybe 3 keywords to search the relevant tables in the database.
Hope this helps

John

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 08, 2006 Dec 08, 2006

Copy link to clipboard

Copied

Further research has led me to believe that I need to use Full Text in MySql. I have found one tutorial showing the PHP code but is there any info about how to set this up in Dreamweaver? I am a newbie to PHP and finding it a challenge.

TIA

John

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 08, 2006 Dec 08, 2006

Copy link to clipboard

Copied

Using Full Text you will have to write most of the sql by hand but you can do this in dreamweaver when creating a recordset choose the advanced tab. If you need help understanding that window click the help button in the advanced window once that window is open. You will first need to setup your table fields to be containied in the fultext. FullText Reference

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 12, 2006 Dec 12, 2006

Copy link to clipboard

Copied

LATEST
I am getting there. Now have a working search as long as I manually type the keywords into the SQL
I am having no luck getting a search box either on the same page or seperately to work. My text field is called 'searchtest' using 'GET' my code from the recordset is shown below.

SELECT artistinfotbl.artistName, artistinfotbl.lastName, MATCH (artistinfotbl.artistName, artistinfotbl.lastName) AGAINST ('$searchtest' IN BOOLEAN MODE) AS score
FROM artistinfotbl
WHERE MATCH (artistinfotbl.artistName, artistinfotbl.lastName) AGAINST ('$searchtest' IN BOOLEAN MODE)
ORDER BY score DESC

It's driving me to drink please can anyone help

Thanks

John

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines