Am 25.02.2008 um 21:56 schrieb Jennifer Ahn:
my $obj = $c->model ('MyAppDB::Student')->update (
{ name => $name },
{ id => $id}
);
I'm updating the name field where the id field is given for the
model called Student. i'm not sure why, but the code above updates
ALL row name fields, not just rows with the particular id. is the
syntax wrong? my
Try:
$c->model( 'MyAppDB::Student' )->find( $id )->update( { name =>
$name } );
Assuming 'id' is defined as your primary key.
--Tobias
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/