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,
Need help with linking
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Need help with linking
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
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.social_experiment wrote:Make the search result a link to the page?
Thanks,
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Need help with linking
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 :
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
Thank you so much buddysocial_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. ?>