Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old May 16th, 2003, 08:41 PM
speedamp speedamp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 speedamp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to speedamp
turn field off/on

Hello.

I am wondering what would be the best way to turn a field on/off in my database.

For example, when a new user registers I would like the status of his account to be "off" (value=0), and once validated then I will change the status to "on" (value=1).

I would like the default to be off.

thanks,
-michael

Reply With Quote
  #2  
Old May 16th, 2003, 10:26 PM
Xmevs Xmevs is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Mosjøen, Nordland, Norway
Posts: 27 Xmevs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: turn field off/on

validated tinyint(1) not null default 0

Reply With Quote
  #3  
Old May 16th, 2003, 10:34 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: turn field off/on

put a field in the table called 'validated' and set it's type to tinyint (mysql doesn't support boolean types yet so use tinyint) and set its default value to 0. "When a user registers, insert their record into the table and don't specify a value for the 'Validated' field (you could also just set the value of the 'validated' field to 0 at this point, but since the default value is 0, you don't have to explicitly give it a value). nowwhen the user tries to log in, see if the value of the 'validated' field is 0 or 1 if it is 0, notify the user that their registration has not been validated yet. whenthe user validates their registration, update the 'validatedfield to 1. I hope that makes sense.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > turn field off/on


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway