I’m in the process of migrating a couple of sites to modx. I’ve got some custom php/mysql apps that I’d like to bring across, but I’m having some trouble. I’ve copied my php code along with mysql queries into a snippet, but I keep getting error messages like:
"« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed - Table ’tonomud_jim.modx_site_templates’ doesn’t exist »"
So I do some searching here, and find this wiki article discussing accessing a mysql database, and it would appear that I can’t just use plain PHP to access another MySQL database on the same server.
http://wiki.modxcms.com/index.php/Access_another_database_from_MODx
So....I did some messing around with my custom php/mysql code and was able to connect to the database "tonomud_jim.works" UNTIL I performed just about any other action (i.e. creating and saving a new page in the manager, etc) which interacted with the database. Then I get the error above, until I re-save/upload my php code again. Make sense?
Any ideas as to what I can do to enable my custom code on this install of modx without having to re-write everything?
I can post code if that will help. Thanks for any help you can provide!