Page 1 of 1

Need help with linking

Posted: Thu Feb 04, 2010 8:56 am
by nagendra802000
Hi All,

I have created a search engine for MP3 with mysql database. Now I want
to connect each search result with its respective info page which will
consist with name of the artist, size, year, and so on. Dose anyone
knows how to do it? I did created few static pages with all these
info. But its impossible to create for thousands of MP3s. Please help
me.

Best,

Re: Need help with linking

Posted: Thu Feb 04, 2010 9:42 am
by social_experiment
Make the search result a link to the page?

Re: Need help with linking

Posted: Thu Feb 04, 2010 9:49 am
by nagendra802000
social_experiment wrote:Make the search result a link to the page?
That I can do. But my problem is that when a user click on a particular MP3 then the detail page should show the info about that particular MP3. I would really appreciate if someone can give me some code or a tutorial links for this issue.

Thanks,

Re: Need help with linking

Posted: Thu Feb 04, 2010 10:12 am
by social_experiment
Pass the ID of the record in a query string, on the page that displays the song information have another query thats selects all information (or required information) from the database where the id is similar to the ID you passed in the query string.

Example :

Code: Select all

<a href="infopage.php?id=$songId">See song info</a>

Code: Select all

<?php $query = mysql_query("SELECT * FROM table WHERE id = '".$_GET['id']."' ");
while ($dp = mysql_fetch_array($query)) {
 echo $dp['fieldname1'];
 echo $dp['fieldname2'];
 //etc.
?>

Re: Need help with linking

Posted: Thu Feb 04, 2010 12:27 pm
by nagendra802000
social_experiment wrote:Pass the ID of the record in a query string, on the page that displays the song information have another query thats selects all information (or required information) from the database where the id is similar to the ID you passed in the query string.

Example :

Code: Select all

<a href="infopage.php?id=$songId">See song info</a>

Code: Select all

<?php $query = mysql_query("SELECT * FROM table WHERE id = '".$_GET['id']."' ");
while ($dp = mysql_fetch_array($query)) {
 echo $dp['fieldname1'];
 echo $dp['fieldname2'];
 //etc.
?>
Thank you so much buddy :) you have saved my life..........:)