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.
This board is great with the help i have been getting!!!!
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.
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
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
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
sorry but your pages are not coming up for me when i click either link.