Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: edi67 on December 11, 2008, 04:05:46 AM

Title: Wrong value type sent to the database. Integer expected.
Post by: edi67 on December 11, 2008, 04:05:46 AM
I having sometimes this strange error when users try to save record of some game.

http://ediboard.altervista.org/index.php?autocom=arcade&do=savescore
Wrong value type sent to the database. Integer expected.
File: /membri/ediboard/Sources/Subs-Db-mysql.php
Riga: 147


line 147 of Sibs_DB-mysql.php is:
Quote
146:     if (!is_numeric($replacement) || (string) $replacement !== (string) (int) $replacement)
==>147:    smf_db_error_backtrace('Wrong value type sent to the database. Integer expected.', '', E_USER_ERROR, __FILE__, __LINE__);
148:    return (string) (int) $replacement;

i searched in forum but not found solution or reply

thx in advance
Title: Re: Wrong value type sent to the database. Integer expected.
Post by: H on January 02, 2009, 07:53:16 AM
Hi edi67, do you still require assistance with this?

As this is related to the arcade, you may get better support on the arcade support site.
Title: Re: Wrong value type sent to the database. Integer expected.
Post by: karlbenson on January 02, 2009, 01:59:49 PM
Its a bug with either smf arcade, OR the game that you were using.

SMF is merely giving an error message because you attempt to send a non-integer when an integer was expected.

Eg the score was 'abcde' instead of 23124.
So like I said, it could either be a bug in smf arcade (not checking for non-integer before attempting to save it).
or
a bad game which is sending out non-integer based scores.

I would suggest raising this in the smf arcades support topic or on the smfarcade.info forum