Errors with PHP 8 from a site created with PHP version 7.1
I built a site in PHP using the MySQLi Server Behaviors, and on the server, it's using PHP version: 7.1. On my localhost, I am using PHP version: 8.1.12. The site is running perfectly on the server, but the client needs some edits done. When I downloaded the files from the server, and try to run the pages locally, I'm getting errors.
Fatal error: Uncaught ArgumentCountError: The number of variables must match the number of parameters in the prepared statement in C:\xampp\htdocs\numeroset\webassist\mysqli\rsobj.php:212 Stack trace: #0 C:\xampp\htdocs\numeroset\webassist\mysqli\rsobj.php(212): mysqli_stmt->bind_param('ii', '0', '1') #1 C:\xampp\htdocs\numeroset\home.php(32): WA_MySQLi_RS->execute() #2 {main} thrown in C:\xampp\htdocs\numeroset\webassist\mysqli\rsobj.php on line 212
Line 212 is: $bindParam = @call_user_func_array(array($query, "bind_param"),$this->paramRefs($rsParams));
Here is another error: Fatal error: Array and string offset access syntax with curly braces is no longer supported in C:\xampp\htdocs\numeroset\webassist\mysqli\rsobj.php on line 145
Line 145: $replace = $this->getSQLValue($params[$x+1],$paramTypes{$x},true);
$startStatement .= substr($endStatement,0,$pos) . $replace;
$endStatement = substr($endStatement, $pos + 1);
}
}
$debugStatement = $startStatement . $endStatement;
And another error: Fatal error: Array and string offset access syntax with curly braces is no longer supported in C:\xampp\htdocs\numeroset\webassist\mysqli\authentication.php on line 204
Is this because of the version differences? If so, how do I correct this? I do have the most recent version of the server behavior installed, FYI.
***UPDATE*** I downgraded my version of PHP to 7.1, like the live site is using, and I'm still getting the exact same errors. So, it doesn't appear that the version is the issue. Can you advise me on how to fix this, please?
Thank you.