Skip to content
General Revolution Evolution Add-ons International
Login | Register | MODX.com
MODX Open Source Content Management System, Framework, Platform and More.
Find a Partner | Hosts + SaaS | Jobs | Donate
  • RegisterSign Up with the MODX Community
  • LoginUse Your MODX.com Account
  • MODX Community Forums
  • General
  • General Support
  •  
  • [Solved] Simple MySQL date query #

  • 36620
    37

    randall Reply #1, 3 months, 2 weeks ago

    Reply
    • Link to this post#1
    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?
    Edited 3 months, 2 weeks ago by randall


  • 4041
    674
    If you wake up breathing, it's a good day...

    breezer Reply #2, 3 months, 2 weeks ago

    Reply
    • Link to this post#2
    maybe try this:
    $res = $modx->db->query( "SELECT id, released FROM `md_disk` WHERE released = '".$release."' ");
    


  • 36620
    37

    randall Reply #3, 3 months, 2 weeks ago

    Reply
    • Link to this post#3
    Thanks breezer, sadly it produces the same result. Very puzzling.


  • 4172
    1,626
    xdbedit - create your own CMP to edit custom-tables with TV-input-types
    MIGX (multiItemsGridTV, sortable multirecord-TV)
    formit2db with autocreate schema&classes
    formit2resource
    custom-tv-input-type for revo:imagelistTV
    quickCMP - CMP for creating simple backend-'modules' per snippets
    bloX/Xedit - Ressource-Listing and frontend-sorting/editing....

    Bruno17 Reply #4, 3 months, 2 weeks ago

    Reply
    • Link to this post#4
    do you want to show us your snippet-call?


  • 36620
    37

    randall Reply #5, 3 months, 2 weeks ago

    Reply
    • Link to this post#5
    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.
    Edited 3 months, 2 weeks ago by randall





Actions

Login to Post

Other Support Options

To file a bug or make a feature request visit our issue tracker, or you can also purchase commercial support.

Love MODX?

If you build sites for a living with MODX or just love using it, why not give back?

Information

Posted in this thread:
Bruno17, breezer, randall

 
Back to Top

MODX Global HQ

1333 N Stemmons Fwy, Ste 110
Dallas, TX 75207
United States

+1 (469) 777-MODX (6639)

The MODX Company

  • Contact
  • Media Center
  • Careers at MODX
  • Wall of Fame
  • The MODX Blog

Sponsors

SoftLayer Firehost: Secure Cloud Hosting

Stay Connected

Read our previous email newsletters.

Twitter Facebook Google+ LinkedIn github Feeds

Privacy Policy | Terms of Service | Pixels by AKTA Web Studio© 2005-2012 MODX. All rights reserved. Trademark Policy