in reply to DBI selectall_arrayref

IF you construct your query into a string and print it out, i think you'll see what the problem is. It will look like:

SELECT 'Field 1','Field 2','Field 3' FROM FROMTABLE

Which has your field names quoted, so MySQL sees them as literals and returns them directly. Since you have no WHERE condition, the result set (of actual rows) is not limited, so you get a result for every row in the table. But since you didnt select any data from the table, but just asked for the literals back, you get them for each row in the table.

If you dont quote the field names, i think you'll get the results you're looking for. I.E.

my $rs = $dbh->selectall_arrayref("SELECT " . join(",", @fromFields) . + " FROM $fromTable");