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
?
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
?
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.