On 06/11/2012 03:51 PM, Mark Haney wrote:
my %attrs = (
shift_name => $q->param('shift_name'),
shift_beg => $q->param('shift_beg'),
shift_end => $q->param('shift_end'),
factory_id => $q->param('factory'),
shift_days => $q->param('DoW'),
);
When I run the script I get this in apache's error.log:
DBIx::Class::ResultSet::new(): No such column T on
Where the 'T' is obviously the T in Tuesday since the Monday and Tuesday
are the only two I selected. I'm missing something simple, but I've not
found any help on Google explaining how checkbox data is passed in a form.
Well, I have an update to this, along with a new problem. Turns out that
a list post from Shawn Corey never actually made it to my inbox. I
stumbled across it when I google the 'no such column' error message
above. He suggested I do this:
shift_days => [ $q->param('DoW') ]
And it sorta works. Now, instead of getting the error message I
actually get data in that column, but it's like this:
14 | Second | 10:23:00 | 10:23:00 | ARRAY(0xa3a6130) | 3 |
Where the 'ARRAY' field should have in it 'MTWThF' (for this particular
row). I'm passing this to a subroutine that looks like this:
$dao->insert_shift(\%attrs); #Sub call
Subroutine:
sub insert_shift {
my $self = shift;
my($attrs) = @_;
my $m = $self->schema->resultset('Shifts')->new($attrs);
$m->insert;
}
I /think/ the problem lies with the $attrs value. But I'm not sure what
to do to fix it.
Help?
--
Mark Haney
Software Developer/Consultant
AB Emblem
ma...@abemblem.com
Linux marius.homelinux 3.3.7-1.fc16.x86_64 GNU/Linux
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/