Hi guys, I really do not know how to make this logic out.
Imagine I would like to get albums and their respective songs from a database and have them sorted; each one with a hyperlink of different sites so it gets to .
Let Apple have its way, as customers will eschew Apple in favor of more open solutions--which is what they should be doing anyway!... I'm not a fan of Apple at all, but when the lawyers in the EUC start dictating to companies how their software should be made, I think the companies should just drop the EU altogether as a market. EUC lawyers make a mint every time they levy a fine on a successful American software company. What a racket. The EU consumer should be the final word on what products he buys and which ones he doesn't, but the EUC seeks to put itself into the position of the EU customer, and make those decisions for him, under the guise of "helping him."
Q. What do you do when the person at your door says, "Hi! I'm from the government, and I'm here to help you make intelligent buying decisions!"
A. Grab your possessions and run for the hills...
Question
Jose_49
Hi guys, I really do not know how to make this logic out.
Imagine I would like to get albums and their respective songs from a database and have them sorted; each one with a hyperlink of different sites so it gets to .
Example:
There's an Album "A" and the songs:
1. "One" (And by clicking I will be redirected to -> http://some_link.com/one?=blahrs)
2. "Two" (And by clicking I will be redirected to -> http://some_link.com/two?=blahrs)
3. "Three" (And by clicking I will be redirected to -> http://totally_different_link.com/one?=blahrs)
4. "Four"....etc...
And there's an album "B" and the songs:
"Track 1" (Same methodology as Album A)
"Track 2"
"Track 3"
I would like to store this info on a MySQL database, and retrieve them using PHP.
How my logic is up to right now:
Create MySQL columns with id, t_id, track, album, link
Where id is the default id mechanism in which the rows will be numbered in the Database.
Where t_id is the track number on the album;
Where track is the track name of the album
Where album is the name of the album
Where link is where I want to redirect to when clicked.
How I think I should proceed (but do not know how to)
Group each row of the table by Album first, in which many tracks will have the same album (I'm lost on how to do this).
Then to each different group, sort them via their t_id (Track number of the current album) (I'm lost on how to do this).
Display the information with their links (Easy part)
I'm planning to display them as follows:
Name goes here
1
Album track #1
Hyperlink #1
2
Album track #2
Hyperlink #2
I did not know how to Google this out....
Furthermore, am I approaching this problem correctly?
Thanks a lot and sorry for the long post.
Link to comment
https://www.neowin.net/forum/topic/1093831-mysql-with-php-help/Share on other sites
2 answers to this question
Recommended Posts