1 Replies - 834 Views - Last Post: 02 November 2013 - 04:34 AM Rate Topic: -----

#1 akneskahi   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 02-November 13

PHP Song Search Form by Artist/Title

Posted 02 November 2013 - 03:31 AM

HI there,

I have created a MySQL database with a table with two rows, Artist and Title, there are about 4000 entries.

I am wanting to create a form where persons can search my database for songs by Artist or Title.

I have searched for several days only to find very complex PHP search scripts that have many more columns, such as for library searches, mp3 searches or art galleries.

I only need to have the PHP script print out a list of titles or artists based upon the words submitted by the form. I would like it to include any title/artist that includes a word or phrase submitted with the form.

Thank you,


Is This A Good Question/Topic? 0
  • +

Replies To: PHP Song Search Form by Artist/Title

#2 andrewsw   User is offline

  • RequestedRangeNotSatisfiable
  • member icon

Reputation: 6554
  • View blog
  • Posts: 26,569
  • Joined: 12-December 12

Re: PHP Song Search Form by Artist/Title

Posted 02 November 2013 - 04:34 AM

IF you need to match a word, or phrase, then you would build a sql-statement using the LIKE clause. If you are searching two fields you would combine this with AND or OR operators.

If your searching is more detailed than this, requiring partial matches, then there is the FULLTEXT feature but it sounds as if your requirement is not this involved.

An alternative to FULLTEXT is to use regular expressions. I suspect that this could be quite slow, and you would need to know something about regex.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1