e1seix Posted February 8, 2008 Share Posted February 8, 2008 Hi all, I have a database which while fiddling about with my php earlier managed to change all the info for over 700 entries. The only way for recovery is to import a copy of the database I thankfully only backed up earlier on too. There is a problem though. My database contains decimal information on prices for many products. When I have uploaded the database text file, it has changed any info that was above 9.99 and defaulted it to 9.99. As my site is an affiliate site, I use regex in php to keep update all prices from the extrernal websites and even when this is performed if the result is more than 9.99 it will still only ever state that it's 9.99. I'm hoping this is something simple to correct but this is crippling me and I am so panicked. What can I do ro what have I done wrong? both values of the datafields are set to decimal 3,2. Any help would be a god-send at this stage. Many thanks, Quote Link to comment https://forums.phpfreaks.com/topic/90000-mysql-disaster/ Share on other sites More sharing options...
e1seix Posted February 8, 2008 Author Share Posted February 8, 2008 PS. I get an out of range error when i try and adjust it manually Quote Link to comment https://forums.phpfreaks.com/topic/90000-mysql-disaster/#findComment-461468 Share on other sites More sharing options...
AndyB Posted February 8, 2008 Share Posted February 8, 2008 http://dev.mysql.com/doc/refman/5.0/en/precision-math-decimal-changes.html If I read that right, you've specified a total of three digits with 2 digits to the right of the decimal, i.e. 9.99 will be the highest value. Quote Link to comment https://forums.phpfreaks.com/topic/90000-mysql-disaster/#findComment-461473 Share on other sites More sharing options...
e1seix Posted February 8, 2008 Author Share Posted February 8, 2008 That's not it mate. I thought decimal 3,2 in the "type" specified a maximum of 3 digits to the left and 2 to the right. Even changing it around, it doesn't fix the problem. Anything else leap out? I am really grateful to anyone! Quote Link to comment https://forums.phpfreaks.com/topic/90000-mysql-disaster/#findComment-461478 Share on other sites More sharing options...
fenway Posted February 8, 2008 Share Posted February 8, 2008 If you're really using the decimal type, AndyB is correct. Quote Link to comment https://forums.phpfreaks.com/topic/90000-mysql-disaster/#findComment-461732 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.