Try as I might, I have searched through the archives and even looked at CGI.pm but have not been able to work out what I am doing wrong.
I have an HTML form with six checkboxes all formatted as such:
<input type="checkbox" name="chk1" value="Listname" onclick="sql()" />
The JavaScript just links to a text box and shows the query being created so the user can check it before sending it to the db.
The name goes from chk1 to chk6 and the value names correspond to column names in a MySQL db. What I need to do is to pass the checked values to a Perl script which is combining all of the values and creating the SQL query. Whilst I can get the rest of the SELECT script to build correctly, I have been unable to get this first section which defines the relevant columns to search to work.
If have tried using:
andif (exists $fd{chk1} ) { push @columns }
if ($fd{chk1} eq "Listname") { $columns = $db->quote($fd{$_}) .","; }
What I was trying to do was to pop the column names into an array, @columns, and then assign the array to $columns which the SELECT command calls but I have managed to lose my way somewhat.
I would be very grateful for any help so I can learn what I have done incorrectly.
Many thanks in advance.
In reply to Checkboxes into an SQL Select query by Quicksilver
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |