Sideclef Posted August 12, 2008 Share Posted August 12, 2008 How do I stop my Data base from producing negative numbers I would like it to stop at 0 Quote Link to comment Share on other sites More sharing options...
akitchin Posted August 12, 2008 Share Posted August 12, 2008 depends on the code putting it in, but the quickest dead-stop way of doing so is by setting the column attribute to UNSIGNED. this can be done through PMA or a MODIFY statement, but i would be wary in the case that you have pre-existing negative integers; not sure how MySQL would react if that was the case. Quote Link to comment Share on other sites More sharing options...
Sideclef Posted August 12, 2008 Author Share Posted August 12, 2008 So if I changed all the negs to 0 then changed it. Would it be ok should I use just UNSIGNED or UNSIGNED ZEROFILL Quote Link to comment Share on other sites More sharing options...
akitchin Posted August 12, 2008 Share Posted August 12, 2008 UNSIGNED is fine; zerofill will add zeroes up to the field's length, and often just makes things more of a pain unless you need them for your specific application. you can either set them to zero or take their absolute values - it sounds as though you would just want to set them to zero. Quote Link to comment Share on other sites More sharing options...
Sideclef Posted August 12, 2008 Author Share Posted August 12, 2008 Thanks a lot much appreciated Quote Link to comment 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.