News:

Wondering if this will always be free?  See why free is better.

Main Menu

Help with database error

Started by FragaCampos, December 06, 2024, 02:54:57 PM

Previous topic - Next topic

FragaCampos

Hi there.

Last August, my server updated PHP version to 8.1 and crashed my forum. After reverting back to the previous PHP version, there were some problems. Recently, I've noticed one of those with sent items in private messages. When I try to open the page index.php?action=pm;f=sent I get this error:


I have another similar one when I try to access another page https://www.docspt.com/index.php?action=ratingsStats



This happened when I reverted PHP 8.1 back to PHP 8.0.



I'm preparing to upgrade to 2.1.5, but while that doesn't happen, I would like to solve these problems. Any help would be much appreciated.

Regards.

vbgamer45

Quick temp fix edit your my.cnf for MySQL and set
sql_mode  = ""

Restart MySQL Service
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

FragaCampos

Thanks, @vbgamer45, but I just don't have that kind of access to the server configuration or if I do I don't know how to do it.  :-\
I only have access to cPanel and to the SMF home directory via ftp.

Anyway, I don't know if it matters, but I just noticed that the server updated again to PHP 8.1 without my knowledge.

vbgamer45

In that case the other option is to modify the core smf files

Sources\Subs-Db-mysql.php(818):
Find
// This makes it possible to have SMF automatically change the sql_mode and autocommit if needed.
if (isset($mysql_set_mode) && $mysql_set_mode === true)
$smcFunc['db_query']('', 'SET sql_mode = \'\', AUTOCOMMIT = 1',
array(),
$connection
);
Change to
$smcFunc['db_query']('', 'SET sql_mode = \'\'',
         array(),
         $connection
      );
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

FragaCampos

That worked! Both pages are back online again. :)

Thank you very much for your help and time!

Advertisement: