We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21395
    • 91 Posts
    Error messages:
    Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/yachtsty/public_html/manager/includes/user_settings.inc.php on line 18

    Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/yachtsty/public_html/manager/includes/user_settings.inc.php on line 20

    Warning: Cannot modify header information - headers already sent by (output started at /home/yachtsty/public_html/manager/includes/user_settings.inc.php:18) in /home/yachtsty/public_html/manager/index.php on line 155

    My hosting company upgraded their servers yesterday. All my MODx sites on this server are affected. All are MODx Evolution 1.0.8. I have upgraded one of them to 1.0.10 to see if this would fix the problem. It didn't. I won't post this on the 1.0.8 Forum.

    New PHP is 5.3.26, new MySQL is 5.5.30.

    I have found references to similar error messages, but no posted solutions, here and generally on the web.

    I have emptied cache files, deleted cached pages, renewed Browser cache and cookies and tested with Firefox and Chrome. Makes no difference. Symptoms all the same.

    Same messages whether I try to save and edited resource or to disable a plugin, then save. So can't disable plugins.

    Any ideas?


    Nic Boyde
      MODX Revolution 2.6.5-pl (traditional)

      Hosted on MODX Cloud

      Skype: nicbaldeagle
      • 16278
      • 928 Posts
      Your problem begins before the lines reporting warnings - the query to extract user settings is failing, and returning FALSE instead of a resource. Lines 16-17:
      	$sql = "SELECT setting_name, setting_value FROM $dbase.`" . $table_prefix . "user_settings` WHERE user=" . $user_id;
      	$rs = mysql_query($sql);

      May be worth checking what your user_settings table looks like using PhpMyAdmin or whatever - maybe something got corrupted during the transfer?

      :) KP
        • 21395
        • 91 Posts
        I did my homework before posting and looked both at the program reporting the error and the database record involved. One record. Fine.

        And none of that has changed from one day to the next. And I can log into the manager, so that database record is there, valid, and has been checked, and the timestamp updated. This problem has affected all my sites, 30-odd, on this same server.

        So it isn't the database, and it isn't the program having scrambled itself - identically - on multiple instances and versions of Evolution. It's probably the database server playing up, and I don't know enough about the problem to know how to complain to the hosting company in a constructive manner. They don't know MODx, don't care, and have no proof other than my say-so that there's an issue. And if it isn't the database server, then I'm stuck.

        Either way, I was hoping that the several people who have experienced exactly these symptoms in the past have discovered a solution. So far, none published, except one lucky soul reporting that the problem had "magically gone away".

        If it helps, I can edit the configuration - the system settings. I updated the server offset time, thinking that might be part of the issue. The edit was accepted, and the database record was changed. I just can't update edit resources and plugins.

          MODX Revolution 2.6.5-pl (traditional)

          Hosted on MODX Cloud

          Skype: nicbaldeagle
            • 21395
            • 91 Posts
            Still a mystery, but the problem did go away shortly after my last post. Sorry, forgot to report.

            It seems that my hosting company did their upgrade in two phases, and when phase 2 was complete - a week after phase 1 - the problem stopped being a problem. They went to PHP5.3.x, then to PHP 5.4.17.

            The best advice I got about the odd messages was this:

            That error message normally means that it did a query but got a failure back and then tried to fetch the results from the failed query.
            Some database records would update, some wouldn't. Seemed to be associated with the admin profile, but hard to tell.

            The hosting people responded with
            We're also having some issues with over-zealous mod_security rules which could be the culprit, and we're working on that tonight.

            Which may have been the problem all along.

            I can't of course tell now whether the changes to Evo just released will fix the problem, because I don't know what the problem really was, nor what has been changed in this release, and it's stopped manifesting itself anyway, but I'm sure that you guys know more about it than I do.

            What was it? My thanks anyway for fixing it (and the unspoken thanks of all those who won't have this problem in the future).

            There were other symptoms of the move to PHP 5.4.17 - including that Ditto stopped working - but I found the fix quickly on these pages and amended my Ditto class files by hand.


            Nic Boyde
              MODX Revolution 2.6.5-pl (traditional)

              Hosted on MODX Cloud

              Skype: nicbaldeagle
              • 3749
              • 24,544 Posts
              The symptoms sound exactly like a mod_security issue. mod_security prevents updates to the DB if it doesn't like something in the data. It sounds like your host has removed some of the troublesome mod_security rules. It may be solved, but there may still be rules that could bite you depending on the content of whatever you're trying to save.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting