We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7327
    • 195 Posts
    Hi,

    Just encountered this when I was trying to edit the publish date manually:

    From 16-04-2013 16:22:00 to 1-04-2013 16:22:00

    MODX encountered the following error while attempting to parse the requested resource:
    « Execution of a query to the database 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 ' unpub_date=0, parent=2, template=7, menuindex='0', searchable=1, cacheable=' at line 2 »

    SQL > UPDATE `modx`.`modx_site_content` SET introtext='', content='
    
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sed nunc id sapien facilisis commodo et sed ligula. Aliquam tincidunt molestie nisl, in malesuada lacus dictum sit amet. Aliquam odio mi, vehicula sit amet auctor vitae, auctor et justo. Integer sem nisi, vulputate sit amet gravida nec, euismod ac nisi. Donec et eros non dolor sagittis dictum.
    ', pagetitle='Test Title', longtitle='', type='document', description='', alias='test-content', link_attributes='', isfolder=0, richtext=1, published=1, pub_date=, unpub_date=0, parent=2, template=7, menuindex='0', searchable=1, cacheable=1, editedby=1, editedon=1368170341, publishedon=publishedon, publishedby=publishedby, contentType='text/html', content_dispo='0', donthit='0', menutitle='', hidemenu='0' WHERE id=11;
    
    


    If I enter a day with a leading zero:

    01-04-2013 16:22:00 instead of 1-04-2013 16:22:00

    No SQL error pops up.