Jump to content

Want to develop Lyrics Finder PHP Site, need help


ameyjah

Recommended Posts

Hi friends,

 

I want to create lyrics finder website like

http://www.azlyrics.com/

. But i am not able to decide to fetch the data from my database. Because most of the time, entered query will not be exact.

 

My Databse Structure:

Assume there are following fields

 

1) actual lyrics text

2) author name

3) tags

 

All of the above fields are text. so if i want to find the song called 'blah blah blah', how do i fire a query. Because using mysql, you can just find whether some records exists if id of song is something something.. but as i am not using any primary key, as user can not remember all primary keys, i am not able to decide, how should i approach this problem.

Link to comment
Share on other sites

i think u are looking for the mysql comparison statement called LIKE.

here some info about it.

http://www.htmlite.com/mysql011.php

u can find alot more info if u google it.

it basicly compare's strings and returns any if matched.

your query would look something like this.

$search_string = 'words to find';
$resource = mysql_query("SELECT * FROM lyrics WHERE lyric_text LIKE '%$search_string%'");

hope this helps

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.