[wp-trac] [WordPress Trac] #21663: Use PDO for MySQL queries when PDO is available

WordPress Trac wp-trac at lists.automattic.com
Wed Aug 22 22:01:14 UTC 2012


#21663: Use PDO for MySQL queries when PDO is available
---------------------------+------------------------------
 Reporter:  scottconnerly  |       Owner:
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Database       |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  needs-patch    |
---------------------------+------------------------------

Comment (by scribu):

 I don't think we should waste effort on making plugins/themes that still
 don't use $wpdb work in PHP 5.4.

 The cleanest way to start using PDO would be something like this:

 {{{
 if ( PDO is available ) {
   require 'wp-includes/wp-db.php';
   $wpdb = new wpdb( ... );
 } else {
   require 'wp-includes/wp-db-legacy.php';
   $wpdb = new wpdb_legacy( ... );
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21663#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list