Incorrect integer for value more than 999

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
ghasembaghi
User
Posts: 293

Incorrect integer for value more than 999

Post by ghasembaghi »

I have a filed with int(11) type in my database and can set value above 999 directly in database.
by in phpmaker(generated script) when i set a value above 999 i got this error: "Incorrect integer".


arbei
User
Posts: 9419

Post by arbei »

Cannot simulate your problem, double check any validation code or code in Server Event and Client Script will change the value.

If you use thousand separator, check your locale file for your language id and make sure the user input (with thousand separator) matches your locale file.


ghasembaghi
User
Posts: 293

Post by ghasembaghi »

I checked other int fields in other tables. This problem was also for them.
I do not use any of the thousands separators.

when i switch web interface to English (with parameter ?language=en in URL) everything is ok but when i switch back to Persian(Farsi) i got error.


arbei
User
Posts: 9419

Post by arbei »

Can you post the settings for the locale of "Persian(Farsi)" here?


polinevol
User
Posts: 24

Post by polinevol »

Hi,
I have the same problem.
I've found that unchecking "Server Side" in php settings of the project resolve the issue


Webmaster
User
Posts: 9430

Post by Webmaster »

You probably have wrong thousand separator (not matching user input) in your locale file. Double check your <lang>.json under C:\Program Files (x86)\PHPMaker <version>\locales.


ppinto
User
Posts: 138

Post by ppinto »

Function ew_CheckNumber doesn't work properly when $EW_THOUSANDS_SEP is a space character.
Edit phpfnXX.php, locate function ew_CheckNumber and change this:

$pat = '/^[+-]?(\d{1,3}(' . (($EW_THOUSANDS_SEP) ? ...

..to this:

$pat = '/^[+-]?(\d{1,3}(' . (($EW_THOUSANDS_SEP == "") ? ...

To make the changes permanent, edit phpfn.php inside the template file.


Post Reply