Thanks!
Looks like we're getting closer:
Here is where I'm at now:
Fatal error: Uncaught Error: Cannot use object of type mysqli as array in /home/noroto5/public_html/Sources/Subs-Db-mysql.php:1080 Stack trace: #0 /home/noroto5/public_html/aveafixposts2.php(58): SMF_DB_MySQLi->query('', '\n\t\t\tSELECT max(...', Object(mysqli)) #1 {main} thrown in /home/noroto5/public_html/Sources/Subs-Db-mysql.php on line 1080