[wp-trac] [WordPress Trac] #51988: Call to undefined function mysql_connect()

WordPress Trac noreply at wordpress.org
Mon Dec 19 20:49:29 UTC 2022


#51988: Call to undefined function mysql_connect()
--------------------------+-----------------------------
 Reporter:  bgin          |       Owner:  (none)
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  Future Release
Component:  Database      |     Version:  5.6
 Severity:  normal        |  Resolution:
 Keywords:  php8          |     Focuses:
--------------------------+-----------------------------

Comment (by sc0ttkclark):

 Seems like we'd want to check if the function `mysql_connect` exists
 before calling it in that else statement for `wpdb::db_connect()`. If it
 does not exist, call `$this->bail()` if `$allow_bail` is true and pass it
 the error message saying MySQL is not available or whatever we want that
 text to be. Otherwise if `$allow_bail` is false then return false.

 For testing this, I'm not sure of a great way to do this but that's
 because I haven't ever tried to do that kind of test case.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51988#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list