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

    I have a database conflict on the main page of my image gallery.
    Note: I have a parent gallery that displays all the child galleries
    I’m using the maxigallery from the repository and modx .95

    The following is the error:
    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « Execution of a query to the database failed - SELECT command denied to user 'userweather'@'localhost' for table 'modx_maxigallery' »
          SQL: CREATE TABLE `modx`.modx_maxigallery ( `id` int(10) unsigned NOT NULL auto_increment, `gal_id` int(10) unsigned NOT NULL, `filename` varchar(50) 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 ;
    Parser timing
      MySQL: 	0.0032 s	(6 Requests)
      PHP: 	0.0780 s	 
      Total: 	0.0812 s


    For some reason it is trying to use my weather snippet’s db information for maxigallery.
    I have this weather snippet in every other page as well and it doesn’t conflict with ditto or jot or any other modx function I’ve used thus far.

    The weather snippet is a separate item I made into a snippet so I can call it within modx.

    The weird thing is it only conflicts with the parent page. If I go directly to a gallery there’s no problem...

    Not sure if you’ve seen something like this before.

    BTW thanks for all your help smiley

    - Josh
      • 7923
      • 4,213 Posts
      No clue why that would happen.. Can you show the weather snippet source?


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 7923
        • 4,213 Posts
        Yeah.. though that it would be like this.. it’s the mysql_connect and mysql_select_db calls that messes it up. Your snippet changes to another database on the fly and MODx starts to use that.

        See this for info on how to connect to another database from modx:
        http://wiki.modxcms.com/index.php/Access_another_database_from_MODx


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 14796
          • 59 Posts
          Cool that corrected it smiley

          Thanks Doze!