Jump to content

Search results from MySQL DB.


joecooper

Recommended Posts

Hi,

 

I'm having some trouble with my search feature on my site. Well my whole site is basically a search engine.

 

I have 2 main fields in my database which need to be searched, but in correct order. They are "SongName" and "SongDesc".

 

Say for example a user searches "Like Toy Soliders" (Eminem song), I would need the script to prioritze the results in order of the amount of words, but in the first field, then the 2nd.

 

Like this:

 

All 3 words in "SongName"

Any 2 words in "SongName"

Any Word in "SongName"

All 3 words in "SongDesc"

Any 2 words in "SongDesc"

Any Word in "SongDesc"

 

Matches would also need to be the whole word, not match "it" to "ditch" for example.

 

Thanks!

 

Joe

 

Link to comment
https://forums.phpfreaks.com/topic/276442-search-results-from-mysql-db/
Share on other sites

I managed to fix the issue with the table type. The results are displaying better, but not in a good enough order.

 

For example, searching "Summer of 69" will display "Bryan Adams - Summer of 69.mp3", but only in like the 60th position. at the top it displays:

 

Jemini Featuring Eddie Law.._Sweet Sweet Summer.mp3
Motels - Suddenly Last Summer.mp3
Dragonette-Our-Summer-Skeet™-Extended-Version.MP3.mp3
Tiga-What-You-Need-Midnight-Conspiracy-Summer-of-87-Remix.mp3
m-flo ft. ryohei - summer time love.mp3
Theme from A Summer Place.mp3

..... and so on

 

 

 

Edit:

 

As I think now my issue isn't about making a search, rather than getting help with the one I have made myself, I will create a new post to stop confusion

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.