in reply to Querying data with and & or when using DBIx::Class

Hi,

have a look at http://search.cpan.org/~ribasushi/DBIx-Class-0.08250/lib/DBIx/Class/Manual/Cookbook.pod#Complex_WHERE_clauses and http://search.cpan.org/~ribasushi/DBIx-Class-0.08250/lib/DBIx/Class/ResultSet.pm#search.

McA

  • Comment on Re: Querying data with and & or when using DBIx::Class

Replies are listed 'Best First'.
Re^2: Querying data with and & or when using DBIx::Class
by phildeman (Scribe) on Sep 17, 2013 at 12:44 UTC
    Thanks for the links. I actually used a sample script from the DBIx::Class::Manual::Cookbook:

    -and => [ -or => [ color => 'Blue', color => 'Orange', ], ID => 1234 ]

    and I got the following error:

    DBIx::Class::ResultSet::search(): DBI Exception: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND => [ -OR => COLOR => BLUE, COLOR => ORANGE, , ID => 1234, ], ) )