[wp-trac] [WordPress Trac] #20178: wpdb class : provide a disconnect / connect to db functions

WordPress Trac wp-trac at lists.automattic.com
Mon Mar 5 16:28:47 UTC 2012


#20178: wpdb class : provide a disconnect / connect to db functions
--------------------------+------------------------------
 Reporter:  arena         |       Owner:  arena
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.4
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |
--------------------------+------------------------------

Comment (by arena):

 Hi ocean90

 the code i am currently using

 {{{
 class data_base
 {
         function mysql_disconnect()
         {
                 global $wpdb;
                 mysql_close($wpdb->dbh);
         }

         function mysql_connect()
         {
                 global $wpdb;
                 $wpdb->__construct(DB_USER, DB_PASSWORD, DB_NAME,
 DB_HOST);
         }
 }
 }}}

 but still have some "mysql_real_escape_string(): nn is not a valid MySQL-
 Link resource" on some webhosts after disconnecting/connecting !

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


More information about the wp-trac mailing list