Opened 15 years ago
Closed 12 years ago
#20178 closed enhancement (duplicate)
wpdb class : provide a disconnect / connect to db functions
| Reported by: | arena | Owned by: | arena |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Database | Version: | 3.4 |
| Severity: | normal | Keywords: | close |
| Cc: | Focuses: |
Description
some hosts automatically disconnect mysql after a short while.
I think it could be interesting to have in wpdb a disconnect and connect functions.
Change History (6)
#1
@
15 years ago
- Summary enhancement : wpdb class : provide a disconnect / connect to db functions → wpdb class : provide a disconnect / connect to db functions
#2
@
15 years ago
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 !
#4
@
13 years ago
- Keywords close added; dev-feedback removed
Unless there's another use case for this, I'm inclined to close this ticket. The reported bug (hosts automatically disconnecting MySQL) will be fixed by #5932.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #5932