|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
RE: turn field off/on
validated tinyint(1) not null default 0
|
|
#3
|
|||
|
|||
|
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.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > turn field off/on |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|