Jump to content


Photo

MySQL Database


  • Please log in to reply
4 replies to this topic

#1 SieRobin

SieRobin
  • Members
  • PipPipPip
  • Advanced Member
  • 212 posts
  • LocationNew Jersey

Posted 26 February 2006 - 02:42 AM

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?

#2 johnnyk

johnnyk
  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 26 February 2006 - 02:46 AM

Edit: nevermind
Rediscover the Web:
<a href="http://www.spreadfir...;t=219"></a><br />

#3 SieRobin

SieRobin
  • Members
  • PipPipPip
  • Advanced Member
  • 212 posts
  • LocationNew Jersey

Posted 26 February 2006 - 03:28 AM

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?

#4 High_-_Tek

High_-_Tek
  • Members
  • PipPipPip
  • Advanced Member
  • 72 posts

Posted 26 February 2006 - 03:46 AM

Well, the cheap way to do it would be this (before you put it in a INSERT query):


if ($var1 > 200){

die('Input is too big!');
}

:D

#5 SieRobin

SieRobin
  • Members
  • PipPipPip
  • Advanced Member
  • 212 posts
  • LocationNew Jersey

Posted 26 February 2006 - 03:48 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users