We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12958
    • 9 Posts
    I wonder if I should use mysql_close() at the end of those snippets, which connect to a database-table outside the modx-database? As far as I know modx itself has a permanent connection to the database - does this mean that mysql_close() will also close this connection and not only the one which I generated via my custom snippet?

    Many thanks in advance!

      • 37099
      • 338 Posts
      Quote from: Inka27 at Jan 19, 2011, 10:02 AM
      does this mean that mysql_close() will also close this connection and not only the one which I generated via my custom snippet?

      Many thanks in advance!



      Not 100% sure but I think it does. I opened a connection to a different db then closed it at the end of the snippet and the webpage failed. I then added the code to reconnected to the original db after the mysql_close() and the page worked again.

      Mike
        • 21838
        • 284 Posts
        MODx core doesn’t use the mysql socket itself but the PDO extension. That’s a completely other way to connect to the database.
          MODX Free Template Base: MODX-Boilerplate | my blog (lots of MODX stuff) | my gitHub (translations) | MODX User Groups Germany (Facebook)