We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29988
    • 89 Posts
    Have anyone considered how we move to mysqli or enable mysqli support?

    More info: http://www.php.net/mysqli

    I would suggest to create a set of bridge functions like

    function mysqli_fetch_array(&$resource){
        return mysql_fetch_array($resource);
      }

    and do a big search&replace to conver all mysql calls to mysqli.

    In these days, I’m moving one site to a server that has only MySQLi support, so I will have to do this at least for me.

    Please take into account that mysqli extension in PHP is better than mysql extension and will be preferred in the future, so there will be time when we would have to move either.

    Btw, there are some deprecated uses of mysql_result() in the source code. This is really awkward command, AFAIK not supported in PHP5. I’ve found two, so it should be easy to convert them.

      • 33175
      • 711 Posts
      Mysqli semms to be a very good extension of PHP but currently the majority of hosters doesn’t offer the possibility to use it ; instead they propose to use the mysql extension undecided
        Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
        • 22303 MODX Staff
        • 10,725 Posts
        I wouldn’t worry about MySQL or MySQLi, or the mysql_result() calls -- MODx is getting a robust PDO data layer soon enough (PDO has it’s own native MySQL drivers when running on PHP 5.1+), and our solution can easily be extended to use MySQLi on PHP 4.x and 5.0.x when native PDO is not available and support for MySQLi is available.
          • 33175
          • 711 Posts
          Will it be compatible with PHP 4 if the extension mysqli is not available?
            Sorry for my english. I'm french... My dictionary is near me, but it's only a dictionary !
            • 22303 MODX Staff
            • 10,725 Posts
            Yes, the PDO for PHP 4 driver I am using for MySQL currently uses mysql functions, but another driver could easily be authored (30 mins or an hour max) to utilize mysqli extensions instead.

            Quote from: Guillaume at Jun 28, 2006, 11:00 AM

            Will it be compatible with PHP 4 if the extension mysqli is not available?
              • 29988
              • 89 Posts
              Hi,

              I have successfully implemented mysqli, becouse my new hosting support only this shit =).

              PM me if you want/need to run MODx on mysqli. It’s two search&replaces and some additional "bridge" library. It works fine, but I’m not sure if in the snippets/plugins in DB aren’t some more mysql_... calls.