當前位置: 首頁>>代碼示例>>PHP>>正文


PHP backupbuddy_core::dbescape方法代碼示例

本文整理匯總了PHP中backupbuddy_core::dbescape方法的典型用法代碼示例。如果您正苦於以下問題:PHP backupbuddy_core::dbescape方法的具體用法?PHP backupbuddy_core::dbescape怎麽用?PHP backupbuddy_core::dbescape使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在backupbuddy_core的用法示例。


在下文中一共展示了backupbuddy_core::dbescape方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

     pb_backupbuddy::status('message', 'Replacing in all tables based on settings.');
     $results = $wpdb->get_results("SHOW TABLES", ARRAY_A);
     foreach ($results as $result) {
         pb_backupbuddy::status('message', 'Replacing in table `' . $result[0] . '`.');
         $dbreplace->bruteforce_table($result[0], array($needle), array($replacement));
     }
     pb_backupbuddy::status('message', 'Replacement finished.');
 } elseif (pb_backupbuddy::_POST('table_selection') == 'single_table') {
     $table = backupbuddy_core::dbescape(pb_backupbuddy::_POST('table'));
     // Single specified table.
     pb_backupbuddy::status('message', 'Replacing in single table `' . $table . '` based on settings.');
     $dbreplace->bruteforce_table($table, array($needle), array($replacement));
     pb_backupbuddy::status('message', 'Replacement finished.');
 } elseif (pb_backupbuddy::_POST('table_selection') == 'prefix') {
     // Matching table prefix.
     $prefix = backupbuddy_core::dbescape(pb_backupbuddy::_POST('table_prefix'));
     pb_backupbuddy::status('message', 'Replacing in all tables matching prefix `' . $prefix . '`.');
     $escaped_prefix = str_replace('_', '\\_', $prefix);
     $results = $wpdb->get_results("SHOW TABLES LIKE '{$escaped_prefix}%'", ARRAY_A);
     foreach ($results as $result) {
         pb_backupbuddy::status('message', 'Replacing in table `' . $result[0] . '`.');
         $dbreplace->bruteforce_table($result[0], array($needle), array($replacement));
     }
     pb_backupbuddy::status('message', 'Replacement finished.');
 } else {
     echo '<script type="text/javascript">jQuery("#pb_importbuddy_working").hide();</script>';
     die('Error #4456893489349834. Unknown method.');
 }
 echo '<script type="text/javascript">jQuery("#pb_importbuddy_working").hide();</script>';
 echo '<br><a href="' . pb_backupbuddy::page_url() . '&parent_config=' . htmlentities(pb_backupbuddy::_GET('parent_config')) . '" class="button secondary-button">&larr; ' . __('back', 'it-l10n-backupbuddy') . '</a>';
 $pb_backupbuddy_js_status = false;
開發者ID:AgilData,項目名稱:WordPress-Skeleton,代碼行數:31,代碼來源:_dbreplace.php


注:本文中的backupbuddy_core::dbescape方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。