SieRobin Posted February 26, 2006 Share Posted February 26, 2006 Can I possibly make it so a field has a certain number assigned to it? Say, I'm running a script.. but I only want that number to actually reach 200 and not go over 200, could I do that? Quote Link to comment Share on other sites More sharing options...
johnnyk Posted February 26, 2006 Share Posted February 26, 2006 Edit: nevermind Quote Link to comment Share on other sites More sharing options...
SieRobin Posted February 26, 2006 Author Share Posted February 26, 2006 I know you can set the character length.. but say you make a int(3) unsigned.. which is 0-255 characters long. Yes of course it sets it to have 3 characters, but that can mean the number can be 999 correct? I just want a max value of 200, instead of going all the way to 999, is this possible? Quote Link to comment Share on other sites More sharing options...
High_-_Tek Posted February 26, 2006 Share Posted February 26, 2006 Well, the cheap way to do it would be this (before you put it in a INSERT query):[code]if ($var1 > 200){die('Input is too big!');}[/code]:D Quote Link to comment Share on other sites More sharing options...
SieRobin Posted February 26, 2006 Author Share Posted February 26, 2006 Hehe, that's the way I have it set up now.. but if the script hasn't ran for over say.. 10 times, then it'll go 201 until the script is caught up. 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.