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

#1 akneskahi  Icon 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,

Arlie

Is This A Good Question/Topic? 0
  • +

Replies To: PHP Song Search Form by Artist/Title

#2 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3642
  • View blog
  • Posts: 12,626
  • 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