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

    I keep receiving different errors around the same issue.

    The error below is the main one I keep getting when synchronising users via the SMF connector. A similar parse error keeps occuring when users register and/or I modify a user via the manager.

    « MODx Parse Error »
    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 ’-dbname.smf_settings (variable,value) VALUES(’integrate_pre_include’,’/home/si’ at line 1 »
    SQL: REPLACE INTO xxxxxxxxxx.smf_settings (variable,value) VALUES(’integrate_pre_include’,’/home/sites/xxxxx.co.uk/public_html/xxxxxxxxx/assets/modules/smforum/smf.integrate.inc.php’);

    This is the one i receive when I try to delete a web user using the manager

    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 ’-xxxxxx.smf_members WHERE BINARY memberName=’someone’’ at line 1 »
    SQL: DELETE FROM webxxx-xxxxxx.smf_members WHERE BINARY memberName=’someone’


    It’s been driving me crazy and I feel like I’m going round in circles trying to find the route of the problem.

    Any help on this issue would be amazing.

    Thank you.

      • 22303 MODX Staff
      • 10,725 Posts
      Both errors are likely because your db names have a - character in them, and are not properly escaped. - is reserved in MySQL and you must escape any SQL that refers to a db name containing that character.
        • 1098
        • 5 Posts
        Thank you for the response,

        The only problem is that the control panel in which I create these databases automatically puts a - in the names, like webxxx-fox.

        Not sure how I can escape this.

        Is there anyway of altering a db name outside of a control panel, which automatically configures them to put - in?

        Cheers for the help.
          • 1098
          • 5 Posts
          hey again,

          Just done some research and realised what you meant by escape characters now.

          I’ve only really dabbled with the usual web design stuff until my boss said I had to find a CMS. I love MODX and its functionability but it does take quite a bit of background knowledge of PHP and MYSQL when things don’t work.

          Do you have any ideas on how to escape characters like that. I’m not sure how or where to input or escape these characters properly.

          Cheers
            • 22303 MODX Staff
            • 10,725 Posts
            Unfortunately, this is a problem with the application code that is executing the queries. You’d have to fix the code by adding `` around the dbname in the queries themselves.