Jump to content

Need help arranging text blob into different sections.


gibigbig

Recommended Posts

I need help arranging a text blob into a table of where each cell is a letter, and the contents of the text blob must be arranged in the table according to what letter it starts with.

 

This is the query I used:

$gibs33 = mysql_query("SELECT name,anime_id,sort FROM anime WHERE popular='1' ORDER BY name ASC"); 
while ($gib33 = mysql_fetch_assoc($gibs33)) {
        echo '<a href="http://www.website.com/index.php?anime_id='.$gib33['anime_id'].'">'.$gib33['name'].'</a> | ';
        }

 

The text blob looks like this:

 

<a href="http://www.narutosoul.com/index.php?categoryid=2&task=series&anime_id=132">Appleseed (2004)</a> | <a href="http://www.narutosoul.com/index.php?categoryid=2&task=series&anime_id=133">Appleseed: Ex Machina</a> | <a href="http://www.narutosoul.com/index.php?categoryid=2&task=series&anime_id=219">Black Rock Shooter</a> | <a href="http://www.narutosoul.com/index.php?categoryid=2&task=series&anime_id=2">Bleach</a> | <a href="http://www.narutosoul.com/index.php?categoryid=2&task=series&anime_id=191">Bleach: Diamond Dust Rebellion</a> | <a href="http://www.narutosoul.com/index.php?categoryid=2&task=series&anime_id=192">Bleach: Fade to Black</a> | <a href="http://www.narutosoul.com/index.php?categoryid=2&task=series&anime_id=190">Bleach: Memories of Nobody</a> | <a href="http://www.narutosoul.com/index.php?categoryid=2&task=series&anime_id=175">Brave Story</a> | <a href="http://www.narutosoul.com/index.php?categoryid=2&task=series&anime_id=207">Canaan</a> | <a href="http://www.narutosoul.com/index.php?categoryid=2&task=series&anime_id=24">Clannad</a> | <a href="http://www.narutosoul.com/index.php?categoryid=2&task=series&anime_id=26">Code Geass Lelouch of the Rebellion</a> | <a href="http://www.narutosoul.com/index.php?categoryid=2&task=series&anime_id=206">Code Geass Lelouch of the Rebellion R2</a> |

 

I want to arrange this blob into a table like this:

 

#-9

A

B

C

D

E

.Hack

AppleSeed

Bleach

Blood+

Basilisk

Claymore

D Gray Man

Eureka 7

Elfen Lied

F

G

H

I

J

K

Fairy Tail

Gundam Seed

[/td]

[td]K-ON Season 2

 

 

etc....

 

 

In the Query,

anime_id = number example: (189)

sort        =  First letter of the word, example (N)

name      = Name of the anime, example (Bleach)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.