We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36620
    • 65 Posts
    In Evo 1.0.5 I've a really simple MySQL query but for some reason I cannot get it to work. $rel is supplied by the snippet call but generates no results, however, if instead I hand code the date in, e.g. $release = "1985-04-01" it works.

    $release = $rel;
    // $release = "1985-04-01";
    echo $release;
     $res = $modx->db->query( "SELECT id, released FROM `md_disk` WHERE released = '$release' "); 


    If I echo $release (when using $rel or "1985-04-01") it correctly shows 1985-04-01 in both instances. Any ideas? [ed. note: randall last edited this post 14 years, 8 months ago.]
      • 4041
      • 788 Posts
      maybe try this:
      $res = $modx->db->query( "SELECT id, released FROM `md_disk` WHERE released = '".$release."' ");
      
        xforum
        http://frsbuilders.net (under construction) forum for evolution
        • 36620
        • 65 Posts
        Thanks breezer, sadly it produces the same result. Very puzzling.
          • 4172
          • 5,888 Posts
          do you want to show us your snippet-call?
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 36620
            • 65 Posts
            The snippet call is:

            [[relatedSingles? &rel=`[+released+]`]]


            The placeholder 'released' is generated from another snippet.

            UPDATE: Yep it was the snippet call that was the problem, changing it to uncached solved it. I'll understand MODx one day. Thanks for both your replies. [ed. note: randall last edited this post 14 years, 8 months ago.]