named: [sql array] SQL [/sql identifier*]
A complete array of arrays, suitable for eval by Perl, can be returned by this query. This tag pair encloses any valid SQL query, and returns the results (if any) as a string representing rows and columns, in Perl array syntax. If placed in an embedded Perl area as:
[perl]
my $string =<<'EOF'; [sql array]select * from arbitrary where code <= '19'[/sql arbitrary]
EOF my $ary = eval $string; my $out = ''; my $i; foreach $i (@$ary) { $out .= $i->[0]; $out .= "<BR>"; } $out;
[/perl]
NOTE: The 'EOF' string terminator must START the line, and not have trailing characters. DOS users, beware of carriage returns!