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.

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

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.