I use the second array idea, except that I store that array in the hash,
under a key that will never be a real key.  In my case, all of my
legitimate keys are lowercase (the database has case-insensitive keys,
and I simulate this in the import by lowercasing the keys), and my array
of keys (with original case) is the 'Order' key.

Using this method, I don't need to worry about cleaning the variable at
the appropriate time, and I don't need to worry about passing an
additional parameter or anything.  It takes a little longer to get to
it, but most of the accesses to the hash don't care about it; it's only
when I finally output it that it's important.

Ed

On Fri, 21 Feb 2003, Alexander Hartmaier wrote:

> Hi!
>
> Because I use a hash instead of an array now I've got the problem that sorting
> with an ORDER BY sql statement is useless ;_(((
>
> I don't want to loose the pros of using a hash (i can reference an the columns
> per name and if I add a new one don't need to touch the others).
> Hast anybody an idea how to handle this problem?
> I thought of a second array which holds the order of keys of the hash....
>
> Have a nice weekend, Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to