Finally have come out again ... ok
So, just tested, and i cannot reproduce into my mums localhost, but yes into a site i follow, so the query that fail based into your report is this:
Code: Select all
$phpbb_user_data = $w3all_phpbb_connection->get_results("SELECT *
FROM ". $w3all_config["table_prefix"] ."groups
JOIN ". $w3all_config["table_prefix"] ."users ON LOWER(". $w3all_config["table_prefix"] ."users.user_email) = '".$email."'
AND ". $w3all_config["table_prefix"] ."users.group_id = ". $w3all_config["table_prefix"] ."groups.group_id");
the problem is that you could check and change the query to be this instead:
Code: Select all
$phpbb_user_data = $w3all_phpbb_connection->get_results("SELECT *
FROM ". $w3all_config["table_prefix"] ."groups
JOIN ". $w3all_config["table_prefix"] ."users ON LOWER(". $w3all_config["table_prefix"] ."users.user_email) = '$email'
AND ". $w3all_config["table_prefix"] ."users.group_id = ". $w3all_config["table_prefix"] ."groups.group_id");
but the result will not change, you'll get anyway
Fatal error: Uncaught Error: Call to a member function get_results() on string
the reason of this, i discovered into another mums installation, is that at some point, and for different functions, the value of the var
$w3all_config_db become empty, so the
Code: Select all
private static function w3all_db_connect(){
on file
class.wp.w3all-phpbb.php lead to the subsequent
Error: Call to a member function get_results() on string
To fix the issue, into a site i follow, i had to do this:
on file
class.wp.w3all-phpbb.php
into function
Code: Select all
private static function w3all_db_connect(){
Code: Select all
else
{
$w3all_config_db["dbhost"] = empty($w3all_config_db["dbport"]) ? $w3all_config_db["dbhost"] : $w3all_config_db["dbhost"] . ':' . $w3all_config_db["dbport"];
$w3all_phpbb_connection = new wpdb($w3all_config_db["dbuser"], $w3all_config_db["dbpasswd"], $w3all_config_db["dbname"], $w3all_config_db["dbhost"]);
}
change into:
Code: Select all
else
{
$w3all_config_db["dbhost"] = empty($w3all_config_db["dbport"]) ? $w3all_config_db["dbhost"] : $w3all_config_db["dbhost"] . ':' . $w3all_config_db["dbport"];
$w3all_phpbb_connection = new wpdb('yourUserName', 'yourdbpasswd', 'yourdbname', 'yourHost');
// yourHost could be yourHost:3306 if port required
}
The use of a CONSTANT in place of the global var
$w3all_config_db should not fix the issue.
As you can see on the same function, the code on it already provide the switch to include a custom config.php, which was the way i solved the issue last time (same result of the above suggested, but in that case vars are coming so from an included custom phpBB config.php).
Think that the CONSTANT array will not fix because if not wrong,
the call to get_option that should contain db connection values, return an empty val!
[EDITED]
Finally have come out again ... ok
So, just tested, and i cannot reproduce into my mums localhost, but yes into a site i follow, so the query that fail based into your report is this:
[code] $phpbb_user_data = $w3all_phpbb_connection->get_results("SELECT *
FROM ". $w3all_config["table_prefix"] ."groups
JOIN ". $w3all_config["table_prefix"] ."users ON LOWER(". $w3all_config["table_prefix"] ."users.user_email) = '".$email."'
AND ". $w3all_config["table_prefix"] ."users.group_id = ". $w3all_config["table_prefix"] ."groups.group_id");[/code]
the problem is that you could check and change the query to be this instead:
[code] $phpbb_user_data = $w3all_phpbb_connection->get_results("SELECT *
FROM ". $w3all_config["table_prefix"] ."groups
JOIN ". $w3all_config["table_prefix"] ."users ON LOWER(". $w3all_config["table_prefix"] ."users.user_email) = '$email'
AND ". $w3all_config["table_prefix"] ."users.group_id = ". $w3all_config["table_prefix"] ."groups.group_id");[/code]
but the result will not change, you'll get anyway
[quote]Fatal error: Uncaught Error: Call to a member function get_results() on string[/quote]
the reason of this, i discovered into another mums installation, is that at some point, and for different functions, the value of the var [b]$w3all_config_db[/b] become empty, so the
[code]private static function w3all_db_connect(){[/code]
on file
[b][i]class.wp.w3all-phpbb.php[/i][/b] lead to the subsequent
[i]Error: Call to a member function get_results() on string[/i]
To fix the issue, into a site i follow, i had to do this:
on file
[b][i]class.wp.w3all-phpbb.php[/i][/b]
into function
[code]private static function w3all_db_connect(){[/code]
[code]else
{
$w3all_config_db["dbhost"] = empty($w3all_config_db["dbport"]) ? $w3all_config_db["dbhost"] : $w3all_config_db["dbhost"] . ':' . $w3all_config_db["dbport"];
$w3all_phpbb_connection = new wpdb($w3all_config_db["dbuser"], $w3all_config_db["dbpasswd"], $w3all_config_db["dbname"], $w3all_config_db["dbhost"]);
}[/code]
change into:
[code]else
{
$w3all_config_db["dbhost"] = empty($w3all_config_db["dbport"]) ? $w3all_config_db["dbhost"] : $w3all_config_db["dbhost"] . ':' . $w3all_config_db["dbport"];
$w3all_phpbb_connection = new wpdb('yourUserName', 'yourdbpasswd', 'yourdbname', 'yourHost');
// yourHost could be yourHost:3306 if port required
}[/code]
The use of a CONSTANT in place of the global var [b]$w3all_config_db[/b] should not fix the issue.
As you can see on the same function, the code on it already provide the switch to include a custom config.php, which was the way i solved the issue last time (same result of the above suggested, but in that case vars are coming so from an included custom phpBB config.php).
Think that the CONSTANT array will not fix because if not wrong, [b]the call to [i]get_option[/i] that should contain db connection values, return an empty val![/b]
[EDITED]