From: Rik Wasmus Date: May 4 2012 10:11am Subject: Re: mixing and matching mysql & mssql whileloop within an if case List-Archive: http://lists.mysql.com/mysql/227323 Message-Id: <201205041211.10804.rik@grib.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > I could suggest a number of ways around the if/else construct, such as > creating a subclass for the various servers with a uniform interface > and hiding the differences inside the class. This, but I'd prefer using one of the already available abstractions for PHP: - PDO: http://www.php.net/PDO - DB: http://pear.php.net/package/DB - MDB2: http://pear.php.net/package/MDB2 - DBAL: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/ ... let's not re-re-reinvent the wheel ;) I would also highly recommend NOT using the mysql extension anymore in PHP for new projects. Use mysqli (mysql Improved) or PDO_MySQL. Also, learn to love prepared statements. -- Rik Wasmus