I've set up a hash which contains information about individual column in a mySQL file. The hash contains the mySQL column name, the "plain text" column name, default column widths for tables, and the default param.
Since there are hundreds of different mySQl columns, I don't want to create the CGI param unless that particular column is needed.
When generating a report, the columns desired are entered into an array, that array is then stepped through, with each $_ acting as the key to the %hash, pulling all the relevant information as needed about any particular column.
example
%sample =
(
'login' =>["Login", 75, qq|textfield('login')|],
'last' =>["Last Name", 75, qq|textfield('last')|],
'first' =>["First Name", 70, qq|textfield('first')|],
'address' =>["Address", 140, qq|textarea('address','',2,40)|]
);
Thus to create a table of just 'last' and 'first', I could reference the correct element of the hash and retreive the correct column name, the default width, and the cgi param to pass in order to create the correct form element. Additionally, if I'm generating a report, all I would need to pull is the column name and size, etc.
I could replace the qq|textfield('xxxx')| with $q->textfield('xxx'), which does work, however, I don't want to generate all those cgi params unless they are needed.
--
Filmo the Klown | [reply] [d/l] |