Click to See Complete Forum and Search --> : More PHP help, please


outrbanx
08-02-2006, 09:04 AM
I am really trying to book-learn all that I can before asking seemingly dumb questions, but it seems that I have to wade through a lot of unrelated information to get to what I need. I don't want to sound lazy, but it all runs together after a while.

I have a table listing song titles. I want to have a column next to each that allows the user to click a link to see the lyrics (stored in the db table). I would like them to appear in a small pop-up window once clicked, but at this point, I will not nit-pick. Just another page will do. :)

What is the best way to achieve this without creating a page for each and every title?

Thanks much in advance.

tubaplaya76
08-02-2006, 09:47 AM
What *I* would do (and I am quite the noob as well) is create a page called 'lyrics.php', for instance. Then, on the previous page where you'll have the supposed link, run an href similar to: <a href='lyrics.php?$id'> where your ID would have been set depending on the song. Then, on the lyrics page, make sure that the ID is submit if ($_GET['id'] && is_numeric($_GET['id'])) {... and SELECT your query using WHERE id = '".$_GET['id']."'";. From there you can format and call whatever you'd like based on whatever ID (or song) the user clicks on.

Hope this helps, and I'm sure there's a much more efficient way to do it!

Cheers