We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27302
    • 154 Posts
    I’ve tried finding a solution to this on these forums, but I can’t find anything that matches my problem precisely.

    I’ve installed Maxigallery, and it was working perfectly. However all of a sudden (without me changing anything!) I have started getting this warning;

    « MODx Parse Error »

    MODx encountered the following error while attempting to parse the requested resource:
    « Execution of a query to the database failed - Table ’modx_maxigallery’ already exists »
    SQL: CREATE TABLE `fiveep_Kangaroo`.modx_maxigallery ( `id` int(10) unsigned NOT NULL auto_increment, `gal_id` int(10) unsigned NOT NULL, `filename` tinytext NOT NULL, `title` text NOT NULL, `date` datetime NOT NULL, `descr` text default NULL, `pos` int(10) default NULL, `own_id` int(10) default NULL, `hide` int(1) default 0, PRIMARY KEY (`id`) ) TYPE=MyISAM AUTO_INCREMENT=1 ;

    I haven’t a clue what any of this means. Could anyone here shed any light on it?

    This error appears on both my ’parent’ page and the child gallery. My calls are straight from the tutorial as follows;

    The parent page.
    [!MaxiGallery? &display=`childgalleries`!]
    


    The child page.
    [!MaxiGallery? &display=`embedded` &embedtype=`slimbox` &pics_per_row=`4` &max_thumb_size=`115` &max_pic_size=`0` &thumb_use_dropshadow=`1`!]
    


    As I mentioned, the confusing thing about this is that it was all working exactly as I wanted it. But then suddenly stopped working for no reason and threw up that parse error.

    My pages are set to be uncached.
      • 7923
      • 4,213 Posts
      Hmm.. have your host possibly changed something? PHP or MySQL updated?

      The parse error is referring to the bit of code where it checks that is maxigallery database table already created and if it’s not, it tries to create it.

      It seems to think that the table isn’t created and tries to create it when it already exists.. If you haven’t done anything, the it’s quite possible that your host has updated something and the code doesn’t seem to run well with that version.

      So please ask your host if they have done something and we’ll take it from there.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 27302
        • 154 Posts
        I’ve just sent a query to the support guys (Hostgator) to find out if anything has changed. Many thanks smiley
          • 27302
          • 154 Posts
          Okay, just had a reply from Hostgator. They said that neither the PHP or SQL has been changed or updated recently.
          • Check the database; if the tables have become damaged somehow perhaps a "repair table" will fix the problem.
              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
              • 27302
              • 154 Posts
              Thanks. The Hostgator guys are taking a look to see if they can identify the problem. I’ve tried creating a clean new gallery page, but even that failed too.
                • 27302
                • 154 Posts
                This is the reply I got off the Hostgator support people. It doesn’t actually mean anything much to me!

                This issue is as follows:

                SQL: CREATE TABLE `fiveep_Kangaroo`.modx_maxigallery

                The page is trying to create the table, instead of access the table. This table already exists. If the installation script was supposed to replace or remove this sub-routing, it has not.


                mysql> show tables;
                +---------------------------------+
                | Tables_in_fiveep_Kangaroo |
                +---------------------------------+
                | modx_active_users |
                | modx_categories |
                ....
                | modx_maxigallery |
                | modx_member_groups |
                | modx_membergroup_access |
                | modx_membergroup_names
                ...
                | modx_webgroup_names |
                +---------------------------------+
                43 rows in set (0.03 sec)

                Please update your script so that it is no longer trying to install the feature.
                • That’s because it doesn’t say much. The table is there, so make the snippet stop trying to create it is all they are saying.

                  It runs a query to check for the table:
                  //validate gallery table
                  $query=mysql_query("DESC $mg->pics_tbl");
                  if(!$query) {
                  ...
                  

                  Perhaps for some reason the DESC keyword is not working properly? Or is returning something that evaluates to false?
                  http://dev.mysql.com/doc/refman/5.0/en/describe.html

                  It might be interesting to put an echo statement in there (line 241 of maxigallery.php) to see what it thinks it’s getting:
                  echo $query; exit();
                    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
                    • 27302
                    • 154 Posts
                    Can I just check if this is the full line you meant?
                    $query=mysql_query("DESC $mg->pics_tbl") echo $query; exit();


                    As you can probably gather I don’t know much about PHP smiley
                    • Yes. What that does is "echo" the results of the query to the screen, stopping the rest of the parser, so all you should see it that output.
                        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