in reply to Syntax to update a table in mysql using catalyst framework

As you mention MySQL, I assume that your model class is a class derived from DBIx::Class. Hence, I further assume that you would update your elements like you would date any other instance of a DBIx::Class derivative. See DBIx::Class::Manual::Intro for a basic introduction to DBIx::Class.

  • Comment on Re: Syntax to update a table in mysql using catalyst framework

Replies are listed 'Best First'.
Re^2: Syntax to update a table in mysql using catalyst framework
by anirudh_sml (Novice) on Jan 08, 2009 at 07:13 UTC
    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

      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