In PHP specifically, no clue.

Using Perl, something like so (and this assumes a 1:1 mapping on
titles/ids):

my $get_art_list = $sql->prepare(<<"eosql");
SELECT title, id
  FROM table
eosql
$get_art_list->execute;

my %articles;
while (my $art = $get_art_list->fetchrow_hashref) {
    $articles{$art->{'title'}} = $articles->{$art->{'id'};}

my @ordered = map {$articles{$_}} sort map
{/^((a)|(an)|(the))\s+(.*)/?$3:$_} keys %articles;

# you now have @ordered, which has key ids in order the way you want them.

Dodger
----- Original Message -----
From: "Bin Zhang" <[EMAIL PROTECTED]>
To: "Msql-Mysql-Modules" <[EMAIL PROTECTED]>; "Mysql"
<[EMAIL PROTECTED]>
Sent: Wednesday, July 25, 2001 5:20 AM
Subject: Sorting w/ leading articles ignored


> Can this be done?  What I want is to generate a list of journal sorted by
> the titles, ignoring the leading articles (the, a, an, etc.).  If there is
> no SQL statement for this, How could I do this w/ DBI or PHP?  I am using
> mysql 3.23.40 on  Solaris 7. Thanks for any advise.
>
> Bin
>
>
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html"; before
> posting. To request this thread, e-mail
[EMAIL PROTECTED]
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail [EMAIL PROTECTED] instead.
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to