Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

questions about powerfull search query for a db

Status
Not open for further replies.

keith23

Technical User
May 26, 2005
97
NL
Hi all i want to build a search query for a database that holds music information. Here is all the fileds :

Note: all feilds in one table!
Code:
filename|artist|album|title|track|comments|genre|seconds|filesize|bitrate
I created this query :

Code:
$query  = "select id,artist,track,album,title from files where title like '%$s%'OR album like '%$s%' OR artist like '%$s%'order by track";

Thre is one edit box with a submit button that allow user to type and this script gets the search word.

Could an expert tell me if this is powerfull enough or is there is any better way to build search method that allow user to get good search results. Should i just keep adding OR and use like % for all fields in my talbe ? I want the user also to be able to type mutiple words in search box .My whole intention is that user be able to find what they look for.I be happy if an expert give me some suggestion and queries.Thanks
 
redesign your table into about three tables. do a search on database normalization. you are storing redundant data in each row.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top