MySQL error

Look here if you're having trouble with BitShop
Post Reply
User avatar
krang
Posts: 28
Joined: Mon Dec 14, 2015 10:27 am
Location: Dimension X
Contact:

MySQL error

Post by krang »

I have updated script to last version and I can't upload file for new product in my shop.
After file is uploaded I have error. Please check attachment.
I didn't change anything inside database, just upgrade to new version 1.1.1
Attachments
error.png
error.png (39.63 KiB) Viewed 12107 times
User avatar
bitfreak
Site Admin
Posts: 98
Joined: Thu Dec 10, 2015 6:57 pm
Location: Australia
Contact:

Re: MySQL error

Post by bitfreak »

Hey man sorry for the delayed response. This is a rather strange problem, I didn't change anything related to the file upload stuff in the newest version of BitShop and I cannot reproduce the problem on my end. For downloadable files, the FileStock field is used to hold the size of the file. So it looks to me like the problem is that 6,47 should have a period and not a comma. That indicates PHP may be configured to return numbers that way, I'll look into a bit more and see what I can find.

EDIT: turns out the round() function will return numbers formatted according to locale settings, freakin PHP...
Please note that the format of this functions output also depends on your locale settings. For example, if you have set your locale to some country that uses commas to separate decimal places, the output of this function also uses commas instead of dots.

This might be a problem when you are feeding the rounded float number into a database, which requires you to separate decimal places with dots.

http://php.net/manual/en/function.round.php#80375
I'll try to include a fix for this in the next version of BitShop which will be out soon.
User avatar
krang
Posts: 28
Joined: Mon Dec 14, 2015 10:27 am
Location: Dimension X
Contact:

Re: MySQL error

Post by krang »

Hmm I resolved this problem by rebooting server ;) Not sure why error occur and what I did to solve it. :) but it works. Thanks.
Post Reply