SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Multiple artist

  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 1999
    Location
    Munster
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am working on a database for a client of mine. What i am doing is having them search thru his databases of songs. The question that i have now is is there a way that i can sort the songs after they do a search by artist. So for example if they search john they would get the list of songs that john denver, elton john, john FOGERTY, and others.

    I would like it so when it displays the results it would be
    Elton John then under his name all of the songs that he does. Then John Denver and display the songs that they did. Can this be done. I have a limited knowledge of php. I know i am diving in prob over my head but I just would like to get this done. Thank you for your help.

    Dave

    This board is great with the help i have been getting!!!!

  2. #2
    SitePoint Wizard jonese's Avatar
    Join Date
    Jul 1999
    Location
    Powder Springs GA (Atlanta)
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    to sort your mySQL results you'll want to end your mySQL statement with ORDER BY <column name>

    as for sorting with the artist name and then the songs it depends on how your database is set up. can you give us an idea of the structure.

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 1999
    Location
    Munster
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The database is set up as follows
    +--------+-----------+------+-----+---------+-------+
    | Field | Type | Null | Key | Default | Extra |
    +--------+-----------+------+-----+---------+-------+
    | songs | char(225) | | | | |
    | artist | char(225) | | | | |
    | album | char(225) | | | | |
    +--------+-----------+------+-----+---------+-----

    if you would like to see how i am sorta working on the database now you can check http://www.sophisticatedsounds.com/c...nly/catol.html

    Any other information that you need I will be more than happy to try to provide it. Thank You Dave

  4. #4
    SitePoint Wizard edshuck's Avatar
    Join Date
    Jul 2000
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi

    i used one of my existing tables and looked at the situation. this is something i anticipate encountering soon. and

    first, select * from tablename order by fieldA, fieldB.

    orders by fieldA and then by fieldB

    then, select * from tablename order by fieldB, fieldA
    orders by fieldB and then by fieldA

    thanks ed

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 1999
    Location
    Munster
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought maybe it would help if you saw what I have know and what i would like to achieve. I made a sample page up on how I would like it to look.
    what it is now. http://www.sophisticatedsounds.com/catol.html
    and this is how I would like it to look http://www.sophisticatedsounds.com/display.html

    Thanks

  6. #6
    SitePoint Wizard edshuck's Avatar
    Join Date
    Jul 2000
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi

    sorry but your pages are not coming up for me when i click either link.

    later

    ed


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •