Properties

$table_prefix

$table_prefix : string

Table prefix.

Type

string

$wpdb

$wpdb : mixed

WordPress Database.

Type

mixed — WordPress Database.

$instance

$instance : 

Private static instance.

Type

— MainWP_DB_Base.

Methods

__construct()

__construct() 

MainWP_DB_Base constructor.

Run each time the class is called.

get_table_name()

get_table_name(mixed  $suffix) : string

Method get_table_name()

Create entire table name.

Parameters

mixed $suffix

Table suffix.

Returns

string —

Table name.

get_my_sql_version()

get_my_sql_version() : mixed

Method get_my_sql_version()

Get MySQL Version.

Returns

mixed —

MySQL vresion.

get_row_result()

get_row_result(mixed  $sql) : mixed

Method get_row_result()

Get row result.

Parameters

mixed $sql

SQL Query.

Returns

mixed —

null|Row

get_results_result()

get_results_result(mixed  $sql) : mixed

Method get_results_result()

Get Results of result.

Parameters

mixed $sql

SQL query.

Returns

mixed —

null|get_results()

query()

query(mixed  $sql) : mixed

Method query()

SQL Query.

Parameters

mixed $sql

SQL Query.

Returns

mixed —

false|$result.

escape()

escape(mixed  $data) : mixed

Method escape()

Escape SQL Data.

Parameters

mixed $data

Data to escape.

Returns

mixed —

Escapped SQL Data.

use_mysqli()

use_mysqli() : boolean|self

Method use_mysqli()

Use MySQLi, Support old & new versions of WordPress (3.9+).

Returns

boolean|self —

false|$instance Instance of \mysqli

ping()

ping(mixed  $link) : mixed

Method ping()

Ping MySQLi.

Parameters

mixed $link

Query link.

Returns

mixed —

\mysqli_ping

m_query()

m_query(mixed  $query, mixed  $link) : mixed

Method m_query()

MySQLi m_query.

Parameters

mixed $query

Query params.

mixed $link

Query link.

Returns

mixed —

\mysqli_query

fetch_object()

fetch_object(mixed  $result) : boolean|mixed

Method fetch_object()

Fetch object.

Parameters

mixed $result

Query result.

Returns

boolean|mixed —

false|\mysqli_fetch_object

free_result()

free_result(mixed  $result) : boolean|mixed

Method free_result()

MySQLi free result.

Parameters

mixed $result

Query result.

Returns

boolean|mixed —

false|\mysqli_free_result

data_seek()

data_seek(mixed  $result, mixed  $offset) : boolean|mixed

Method data_seek()

MySQLi data seek.

Parameters

mixed $result

Query result.

mixed $offset

Query offset.

Returns

boolean|mixed —

false|\mysqli_data_seek

fetch_array()

fetch_array(mixed  $result, null  $result_type = null) : boolean|mixed

Method fetch_array()

MySQLi fetch array.

Parameters

mixed $result

Query result.

null $result_type

Query result type.

Returns

boolean|mixed —

false|\mysqli_fetch_array.

num_rows()

num_rows(mixed  $result) : boolean|mixed

Method num_rows()

MySQLi number of rows.

Parameters

mixed $result

Query result.

Returns

boolean|mixed —

false|\mysqli_num_rows.

is_result()

is_result(mixed  $result) : boolean|mixed

Method is_result()

Return instance of \mysqli_result

Parameters

mixed $result

Query result.

Returns

boolean|mixed —

false|\mysqli_result

test_connection()

test_connection() 

Method test_connection()

Test db connection.

table_name()

table_name(mixed  $suffix, null  $tablePrefix = null) : string

Method table_name()

Create entire table name.

Parameters

mixed $suffix

Table suffix.

null $tablePrefix

Table prefix.

Returns

string —

Table name.