It is currently Tue Mar 19, 2019 9:42 am


All times are UTC


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Need help with a code, php / mySQL
PostPosted: Thu Jun 01, 2006 5:57 pm 
Newbie
Newbie

Joined: Thu Jun 01, 2006 5:41 pm
Posts: 2
Hello. I'm having trouble constructing a relatively simple code. Basicly, what I am doing is that I have a table made of 'artist' & 'album' (also an ID field but it shouldn't matter).

And there is no need to code the whole thing for me, pointing me towards some neat functions that can help me out ought to be enough.

I am trying to have the php script take every row and output it like this:

Code:
<p><a name="A" id="A">A</a><br />
Amon Amarth - Fate of Norns<br />
Amon Amarth - Once Sent From the Golden Halls<br />
<a href="#top">Top</a></p>


And then the same with every other alphabetical and numeral character.

While this is a relatively simple thing, I do not get it how to have my script execute 3 things:
1 - List albums Alphabetically. I am relatively new to mySQL, but more expirienced in php, but I recon this is a thing best done when we use the 'SELECT' command to obtain data from the database, rather than ordering it later. However I do not quite get it how to do it, seeing I'm already ordering by Artist first, basicly it should be like this in the end:

111 - 111
111 - 222
aaa - bbb
aaa - zzz
artist - album
artist2 - album2

Edit: Solved

Now, for the second problem. This is what really makes this code something. I also wish that say, artist starting with 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 are put into a single subgroup of [0-9] or something similar because since there are so few artists that have names starting with numbers there is only just enough material for 1 'group' for me.

example:
[0-9]
1artist - Abcd
3art - efgh
4artist - ijkl

A
aartist
and so on...

And in a similar manner, combinging characters like A & Ã


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ]  Moderators: Moderators, Support Team

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Hosting | Domains | Servers | Extras | Order | Support | Contacts | FreeHostia © 2011