nickt9999 has asked for the wisdom of the Perl Monks concerning the following question:
Hi All,
I am after some help on SQL results and sorting.
A manual SQL query returns the following:
I am print the results to file using:+--------+--------+ | userid | giftid | +--------+--------+ | 42128 | 1 | | 101932 | 1 | | 105596 | 2 | | 107736 | 3 | | 109274 | 2 | +--------+--------+
However it prints to file as this:while($row_ref = $sth->fetchrow_hashref()) { print F "$row_ref->{$_} " for keys %$row_ref; print F "\n"; }
1 42128 1 101932 2 105596 3 107736 2 109274
Is there a way to get it to print to file in the way the results from the query are returned?
Thanks In Advance
Nick
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Sorting SQL results
by roboticus (Chancellor) on Oct 11, 2013 at 18:03 UTC | |
by nickt9999 (Acolyte) on Oct 11, 2013 at 19:10 UTC | |
Re: Sorting SQL results
by choroba (Cardinal) on Oct 11, 2013 at 17:57 UTC | |
by nickt9999 (Acolyte) on Oct 11, 2013 at 18:03 UTC | |
by Anonymous Monk on Oct 11, 2013 at 21:04 UTC | |
Re: Sorting SQL results
by runrig (Abbot) on Oct 16, 2013 at 20:38 UTC | |
Re: Sorting SQL results
by sundialsvc4 (Abbot) on Oct 15, 2013 at 03:35 UTC | |
by roboticus (Chancellor) on Oct 15, 2013 at 10:22 UTC | |
by spandox (Novice) on Oct 16, 2013 at 18:20 UTC | |
by roboticus (Chancellor) on Oct 17, 2013 at 17:01 UTC |
Back to
Seekers of Perl Wisdom