in reply to Re: Syntax to update a table in mysql using catalyst framework
in thread Syntax to update a table in mysql using catalyst framework

Hi monks my problem is not solved yet please help me .
The problem is i am updating the table through
my $profile_update= $c->model('DBMain::Table')->update( { table_feild1 => $value, table_feild2 => $value2, }, { key => $value3} );
This is updating all the records how to put where clause in it .
Thanks

Replies are listed 'Best First'.
Re^3: Syntax to update a table in mysql using catalyst framework
by Corion (Patriarch) on Jan 08, 2009 at 07:26 UTC

    DBIx::Class comes with lots of documentation. I guess you will have to read it, instead of asking us to read it for you.

    In your specific case, I would assume that you would first ->search() for the rows you want to change, and then do $resultset->update(), to change these rows.

    But, to reiterate, you will have to learn lots and lots about DBIx::Class. Or, if you "just" want to write some SQL, you will have to ditch using DBIx::Class as your model in Catalyst and write your own model. This should be possible, but I haven't done any of this, as I find that writing my own framework is about as much hassle as using one of the premade frameworks.

      Thanks a lot