Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

There is no explicit method. It stores link identifier in $wpdb->dbh field, so I guess you could use mysql_close() on it.

Why do you need it btw? If you want to reuse $wpdb it is better to create separate wpdb object instead.

share|improve this answer
    
means it is not needed to close global wpdb connection???? –  Brij Feb 1 '11 at 9:38
    
@Brij unless I am missing something it should be closed automatically when page finishes loading and PHP ends execution. –  Rarst Feb 1 '11 at 9:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.