Need help with linking

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nagendra802000
Forum Newbie
Posts: 3
Joined: Thu Feb 04, 2010 8:54 am

Need help with linking

Post 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,
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Need help with linking

Post by social_experiment »

Make the search result a link to the page?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
nagendra802000
Forum Newbie
Posts: 3
Joined: Thu Feb 04, 2010 8:54 am

Re: Need help with linking

Post 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,
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Need help with linking

Post 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.
?>
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
nagendra802000
Forum Newbie
Posts: 3
Joined: Thu Feb 04, 2010 8:54 am

Re: Need help with linking

Post 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..........:)
Post Reply