We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5253
    • 17 Posts
    Sorry guys, didn't find anything in the docs... sad

    I have a multiple where condition:
    $c->leftJoin("ugallerymeta_data", "Metadata", "Metadata.resource_id = ugallerymeta.id");
    $c->where(array("class_key" => "ugalleryMeta", "Metadata.dimensions_outer_height:>" => "Metadata.dimensions_outer_width" ));
    


    When I take a look at the mysql query the where condition is translated to this:
     AND `Metadata`.`dimensions_outer_height` > '`Metadata`.`dimensions_outer_width`' 
    


    The "value" is obviously treated as a string and so my question is: Is there a way to compare to table fields in a where statement?

    thanks a lot,
    Chris
      *there are no strangers - just friends who never met*
      • 22303 MODX Staff
      • 10,725 Posts
      $c->where(array(
          "class_key" => "ugalleryMeta", 
          "Metadata.dimensions_outer_height > Metadata.dimensions_outer_width"
      ));
        • 5253
        • 17 Posts
        yay... thank you very much smiley
          *there are no strangers - just friends who never met*