CACHE_OPTION_NAME
CACHE_OPTION_NAME ='mw_complex_query'
Define your complex SQL query. When implementing your complex query do not use global $wpdb; in your methods. Use ::getWpdb() instead.
A complex query can be splitted into three parts:
** File not found : $rows **
procedure(): mixed
This function is called when procedures (stored functions and procedures) are available. It is also necessary that mysqli is in use. mysql_connect does not support store_results() method. This method should return your expected result. You should work with this::hasProcedure() to install your procedure if not exists.
A procedure can for example write into a temporary table and reads from it again.
getProcedureResults(string $sql,boolean $returnTrue = false): Array
Call a "CALL proc" SQL and parse the results.
string | $sql | The SQL string to execute |
boolean | $returnTrue | When the CALL is successfully and has no results then return true instead of an empty array |
or false when an error occur