• 0

MySQL with PHP help


Question

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

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Chrome is Google's commercial web browser product; it consists of their proprietary features (Googlified everything including profile sync) plus their chromium project barebones web browser. Google developers control the chromium project. The chromium project is the "core" for the web browser product from other vendors including Microsoft Edge (their own proprietary features), Opera (their own features), Brave (their own features), etc... The "downstream" teams at Microsoft, Opera, Brave, etc., can either integrate their original MV2-supporting code into future builds, or they can integrate chromium wholesale and simply add-on their own features/functionalities -- their 'current' build pipeline, so to speak. THIS is why changes at the chromium project affect so many products besides only Google's commercial Chrome browser. -- Edit to add: The chromium project is open-source, and is the piece that's Google's code contribution to the W3C and world wide web at large; there are no licensing fees for others to use the code in their own products... which is what they do. Other browser engines do exist (Firefox's for example) but it's nearly impossible to have both engines bundled into the same 1 browser product.
    • You're comparing settler colonies to colonized war torn nations. It's easy to become the richest by coming in and stealing other people's land, culture and resources.
    • ABP has become "old news" when MV3 started rolling out. They've gone downhill and is now simply irrelevant..... in my experience.
    • About two years ago, I switched to Brave and haven't looked back.
    • FWIW StatCounter has been trash for over 25+ years! Back in the day (circa 2000 and GeoCities pre-Blogger era), it was useful to paste a number on your webpage indicating how many visitors you had. In the ensuing 25+ years, they've grown in reputation and changed their ways... but their overall consumer value has remained abysmal. Serious marketing agencies only cite StatCounter when there's literally no other sources available to support any marketing claims! They are the absolute lowest threshold serious companies use to push any sort of narrative about this-or-that happening. Besides their credibility being what it is, they are forever subject to quality issues. They're so bad that my DNS-level ad-filter prevents me from even viewing their main website! HA!
  • Recent Achievements

    • Week One Done
      rubentuben8 earned a badge
      Week One Done
    • Week One Done
      ARaclen earned a badge
      Week One Done
    • One Year In
      jojodbn earned a badge
      One Year In
    • One Month Later
      jojodbn earned a badge
      One Month Later
    • Week One Done
      jojodbn earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      531
    2. 2
      PsYcHoKiLLa
      231
    3. 3
      +Edouard
      131
    4. 4
      ATLien_0
      88
    5. 5
      Steven P.
      81
  • Tell a friend

    Love Neowin? Tell a friend!