Is there any method to close connection similar to mysql_close() for $wpdb in WordPress?

Is it not necessary to close connection for global $wpdb?

3 s
3

You don’t have to worry about closing connection to you DB because it will be automatically closed when a request will be processed by your server.

But if you have to close it, then you can do something like this:

@mysql_close( $wpdb->dbh );

Pay attention that it could lead to unexpected results because other plugins could rely on this connection.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *