how to record 3-digit zeros

Thread Solved

Join Date: Aug 2009
Posts: 31
Reputation: AdventDeo is an unknown quantity at this point 
Solved Threads: 0
AdventDeo AdventDeo is offline Offline
Light Poster

how to record 3-digit zeros

 
0
  #1
Oct 6th, 2009
Okay idk if it's possible but I want one of my fields to have 000 as a default value and to maintain this value whenever called for. Like if I use PHP to run a query that asks for that field I want it to return "000". I'm doing this coz I'm playing with version records here.

OK so there's this thing called Zerofill, but I want it a little different. I want this field to be able to store INTEGER(5), but default value "000", a three-digit zeros. So if user do not enter any number, it will be "000", but user MAY enter up to 5 digits....
Last edited by AdventDeo; Oct 6th, 2009 at 4:44 am.
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 525
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 61
network18 network18 is offline Offline
Posting Pro
 
0
  #2
Oct 6th, 2009
hey its impossible to have any integer number '0' stored as '000' because it wil violate its defenition.
The easy way to have the db it that way, store '0' and display it '000' when it comes to scripting.
hope this might help you.
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 31
Reputation: AdventDeo is an unknown quantity at this point 
Solved Threads: 0
AdventDeo AdventDeo is offline Offline
Light Poster
 
0
  #3
Oct 6th, 2009
Hmmm.... I guess that can work huh... thanks dude! =)
case closed!
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 525
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 61
network18 network18 is offline Offline
Posting Pro
 
0
  #4
Oct 6th, 2009
that's great
have happy time and please mark the thread as solved.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC