Jump to content

Archived

This topic is now archived and is closed to further replies.

SieRobin

MySQL Database

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.