MyBB Community Forums

Full Version: Problem with PHP 7.4
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

upgrade to php 7.4 and I am getting the following error:

Notice: Trying to access array offset on value of type bool in /home/public_html/inc/db_pgsql.php on line 444

This is the code  in db_pgsql.php:

	function fetch_field($query, $field, $row=false)
	{
		if($row === false)
		{
			$array = $this->fetch_array($query);
			return $array[$field];
                        ///the previous line is the problem
		}
		else
		{
			return pg_fetch_result($query, $row, $field);
		}
	}


Best Regards
Hmm..

DB_PgSQL::fetch_array() seems to be returning FALSE: https://github.com/mybb/mybb/blob/featur...#L426-L428 which is called by DB_PgSQL::fetch_field().
Could you please post the full backtrace of this Notice type error?
This was I found in logs

[Thu Jul 09 08:17:29.845909 2020] [proxy_fcgi:error] [pid 2558:tid 140086498768640] [client 94.98.251.22:63233] AH01071: Got error 'Primary script unknown'
[Thu Jul 09 15:18:12.626352 2020] [proxy_fcgi:error] [pid 2558:tid 140086473590528] [client 187.189.164.78:12030] AH01071: Got error 'PHP message: PHP Notice: Trying to access array offset on value of type bool in /home/public_html/inc/db_pgsql.php on line 444', referer: index.php
Notice type errors are suppressed by MyBB by default and can be ignored usually: no major drawbacks.
(2020-07-09, 04:58 PM)noyle Wrote: [ -> ]Notice type errors are suppressed by MyBB by default and can be ignored usually: no major drawbacks.

Added the following in my php file, but just show me the notice type error and no run the php code

ini_set("display_errors", 0);
ini_set("display_startup_errors", 0);
error_reporting(0);