List:General Discussion« Previous MessageNext Message »
From:Rik Wasmus Date:May 4 2012 10:11am
Subject:Re: mixing and matching mysql & mssql whileloop within an if case
View as plain text  
> 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
Thread
mixing and matching mysql & mssql whileloop within an if caseHaluk Karamete3 May
  • RE: mixing and matching mysql & mssql whileloop within an if caseRick James3 May
  • Re: mixing and matching mysql & mssql whileloop within an if caseCharles Brown3 May
  • Re: mixing and matching mysql & mssql whileloop within an if caseBaron Schwartz3 May
    • Re: mixing and matching mysql & mssql whileloop within an if caseRik Wasmus4 May
  • Myisam won't support replicationCharles Brown3 May
    • Re: Myisam won't support replicationAndrew Moore3 May
      • RE: Myisam won't support replicationRick James3 May
      • Myisam won't support replication in an MySQL Cluster environment Charles Brown4 May
  • Myisam won't support replication in an MySQL Cluster environment Charles Brown4 May
    • Re: Myisam won't support replication in an MySQL Cluster environmentReindl Harald4 May
      • RE: Myisam won't support replication in an MySQL Cluster environmentCharles Brown4 May
        • Re: Myisam won't support replication in an MySQL Cluster environmentReindl Harald4 May
        • Re: Myisam won't support replication in an MySQL Cluster environmentJohan De Meersman7 May
  • Re: mixing and matching mysql & mssql whileloop within an if caseAlex Schaft4 May