We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44320
    • 17 Posts
    No returns for either copy past your code or this:
    $query->leftJoin('modTemplateVarResource', 'tv13', 'tv13.contentid = modResource.id'); //with a custom join-alias, you need to define a ON - statement
    $query->where(array(
       'modResource.parent' => 679,
       'modResource.published' => 1,
       'tv13.tmplvarid' => 13,
       'tv13.value' => 603
    ));
    


    :(
      • 4172
      • 5,888 Posts
      Quote from: Bruno17 at Jul 12, 2013, 03:40 AM
      what do you get with

      $query->prepare();echo $query->toSql();


      try to see what you get with this generated query in phpmyadmin
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 44320
        • 17 Posts
        That returns:
        ERROR 1054 (42S22): Unknown column 'tv_value.resourceid' in 'on clause'
        


        I played around with that but I'm really taping in the dark here.
        Thanks for the help!
          • 44320
          • 17 Posts
          I got it!

          The query is:
          $query->leftJoin('modTemplateVarResource', 'tv_value', 'tv_value.contentid = modResource.id');

          I looked into the query and database and now understand what that translates to.
          The
          $query->prepare();echo $query->toSql();
          really helped here!

          Thanks @bruno17