📁 File Manager Pro
v10.0.2 | PHP: 8.1.34
Server: LiteSpeed
2026-06-26 10:03:47
📂
/
/
home
/
pallabnv
/
public_html
/
wp-content__3bb9dea
/
plugins
/
wp-mail-smtp
/
src
/
Helpers
✏️
Editing: DB.php
<?php namespace WPMailSMTP\Helpers; /** * Class for Database functionality. * * @since 3.6.0 */ class DB { /** * The function is used to check if the given index exists in the given table. * * @since 3.6.0 * * @param string $table The table name. * @param string $index The index name. * * @return bool If index exists then return true else returns false. */ public static function index_exists( $table, $index ) { global $wpdb; $query = $wpdb->prepare( 'SELECT COUNT(1) IndexIsThere FROM INFORMATION_SCHEMA.STATISTICS WHERE table_schema = DATABASE() AND table_name = %s AND index_name = %s', $table, $index ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared $result = $wpdb->get_var( $query ); return $result === '1'; } }
💾 Save Changes
❌ Cancel