SMF Ads Support Forum

Support => Bugs => Topic started by: melktert on April 06, 2019, 09:51:18 am

Title: Database error after upgrading to Mysql 5.7
Post by: melktert on April 06, 2019, 09:51:18 am
Hi

I'm getting the following errors in my log since upgrading to Mysql 5.7:

Database Error: Out of range value for column 'HITS' at row 1Apply
Filter: Only show the errors from this file File: /home/brokenwiener/public_html/forums/Sources/LoadAds.php
Line: 298


Forum displays this at the bottom:
Out of range value for column 'HITS' at row 1
File: /home/brokenwiener/public_html/forums/Sources/LoadAds.php
Line: 298

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.15, while your database is at version 2.0.4. The above error might possibly go away if you execute the latest version of upgrade.php.


Error 298 refers to:
Code: [Select]
$smcFunc['db_query']('',"UPDATE {db_prefix}ads SET hits = hits+1 WHERE ADS_ID = $id"); in LoadAds.php

Version Information:
Forum version: SMF 2.0.15 (more detailed)
Current SMF version: SMF 2.0.15
GD version: bundled (2.1.0 compatible)
Database Server: MySQL
MySQL version: 5.7.25-log
PHP: 5.6.40
Server version: Apache/2.4.39 (cPanel) OpenSSL/1.0.2r mod_bwlimited/1.4

Any ideas how to clear this?


Title: Re: Database error after upgrading to Mysql 5.7
Post by: vbgamer45 on April 06, 2019, 09:53:05 am
You have to increase the hits column in the ads table to a larger integer datatype.
Title: Re: Database error after upgrading to Mysql 5.7
Post by: melktert on April 06, 2019, 09:58:53 am
Thanks

I changed the hits value to 1 and that took the error away.

What datatype do you suggest?
Title: Re: Database error after upgrading to Mysql 5.7
Post by: vbgamer45 on April 06, 2019, 10:00:16 am
bigint i believe that's what I used in the latest version.
Title: Re: Database error after upgrading to Mysql 5.7
Post by: melktert on April 06, 2019, 10:03:34 am
Thank you
I've made the change. I did upgrade to latest version but appears it didn't update the database.

Thanks again for your help