| @@ 163-177 (lines=15) @@ | ||
| 160 | return false; |
|
| 161 | ||
| 162 | // php < 7.0 need this |
|
| 163 | if (empty($db_connection)) |
|
| 164 | { |
|
| 165 | $db_options = array(); |
|
| 166 | ||
| 167 | // Add in the port if needed |
|
| 168 | if (!empty($db_port)) |
|
| 169 | $db_options['port'] = $db_port; |
|
| 170 | ||
| 171 | if (!empty($db_mb4)) |
|
| 172 | $db_options['db_mb4'] = $db_mb4; |
|
| 173 | ||
| 174 | $options = array_merge($db_options, array('persist' => $db_persist, 'dont_select_db' => SMF == 'SSI')); |
|
| 175 | ||
| 176 | $db_connection = smf_db_initiate($db_server, $db_name, $db_user, $db_passwd, $db_prefix, $options); |
|
| 177 | } |
|
| 178 | ||
| 179 | // First try to update an existing row... |
|
| 180 | $smcFunc['db_query']('', ' |
|
| @@ 575-589 (lines=15) @@ | ||
| 572 | require_once($sourcedir . '/Subs-Db-' . $db_type . '.php'); |
|
| 573 | ||
| 574 | // Make the connection... |
|
| 575 | if (empty($db_connection)) |
|
| 576 | { |
|
| 577 | $options = array('non_fatal' => true); |
|
| 578 | // Add in the port if needed |
|
| 579 | if (!empty($db_port)) |
|
| 580 | $options['port'] = $db_port; |
|
| 581 | ||
| 582 | if (!empty($db_mb4)) |
|
| 583 | $options['db_mb4'] = $db_mb4; |
|
| 584 | ||
| 585 | $db_connection = smf_db_initiate($db_server, $db_name, $db_user, $db_passwd, $db_prefix, $options); |
|
| 586 | } |
|
| 587 | else |
|
| 588 | // If we've returned here, ping/reconnect to be safe |
|
| 589 | $smcFunc['db_ping']($db_connection); |
|
| 590 | ||
| 591 | // Oh dear god!! |
|
| 592 | if ($db_connection === null) |
|