We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8425
    • 159 Posts
    Hello,
    I’m using MODX 1.0.5. I’m facing a weird error. I can launch the site from the manager but when I log out, I’m getting this database error.
    Does anyone has any idea of what might be wrong and where should I start to debug this... I noticed that I had some wierd character "Â" in one page contents. I removed all of them. I don’t know if it has anything to do with that.
    Any help would be greatly appreciated.
    Thanks in advance

    « 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 '' at line 1 »
          SQL: SELECT setting_name, setting_value FROM `testdatabase`.`modx_user_settings` WHERE setting_name='manager_language' AND user= 


      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Does the site work if you go to the site without logging in at all?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 8425
        • 159 Posts
        No it doesn’t....
          • 36404
          • 307 Posts
          hi,

          have you checked your php/mysql releases, there is a know bug that could... bug you if you’re using some wamp/xamp/mamp (or else) "l"amp distrib
          http://modxcms.com/forums/index.php?topic=60114.0

          something else, as you’re speaking about strange chars, have you checked the db charset is set on utf8_general_ci ?

          have swing

          edited just to say: you should not leave your mail address in the post if you don’t want to be spammed or, at least write it this way xxxx [at] wwww [dot] ca....
            réfléchir avant d'agir
            • 8425
            • 159 Posts
            Ok, I think my problem comes from special character such as ó. PhpAdmin doesn’t export them properly. I’m using utf8_general_ci. Does anyone know how to export from MODx specials characters as they are getting lost in the process of changing database and I don’t really want to go and edit the file by hand.
            Any suggestion/advice is welcome.
            Thanks
              • 36404
              • 307 Posts
              hi

              phpMyAdmin usually exports the db correctly

              being French, the least i can say is that my dbs are loaded with special chars... and actually the only time i’ve had problem with was once when forgetting to set the db charset to utf8 before importing the db on a new server
              solved it exporting the db without compatibility, deleting all the tables, setting the right default charset for the db and then importing the whole stuff again.

              now if you former db charset was not utf8 you may have those strange chars already in the db... (check a content in phpMyAdmin) you’ll have to deal with this the hard way... make a dump, make sure your file is an utf8 file and then search/replace, sorry smiley

              have swing
                réfléchir avant d'agir
                • 8425
                • 159 Posts
                Thanks for the advice, I’ve fixed it now.
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Indeed, I have found that with most CPanel systems you first create the database, then you have to go into phpMyAdmin and set its collation to utf-8.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org