Navicat - Default Value

Status
Not open for further replies.

Benjames

Member
Jan 2, 2013
103
2
HELLO,

Can someone tell me how to set a default value in Navicat. (Mysqldatabase) for example, when another row is added/user registers their password is by default pass123. (Thats not the actual usage & i dont need it to overwrite anything previous because it will be an empty field.

Thanks

Ben

Sorry if this is in wrong place, its nothing to di with Habbo so I didn't know where toput it.
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,132
2,456
Do it trough a query
Code:
ALTER TABLE users ADD COLUMN password varchar (20) DEFAULT 'pass123' ;
 

zMagenta

Posting Freak
Jul 15, 2011
1,414
682
Code:
ALTER TABLE users ALTER password SET DEFAULT 'test123';

That should work.
 

Benjames

Member
Jan 2, 2013
103
2
Code:
ALTER TABLE users ALTER password SET DEFAULT 'test123';

That should work.

Thanks both of you. This is extremely helpful. Not tested them but I assume they work. You're both amazing!;)

Thread can be closed. Question answered :--)
 

Kaz

BooYah
Staff member
Nov 16, 2010
3,064
1,025
Closed on request, if the above codes give you any issues pm me and i will re-open this thread
 
Status
Not open for further replies.

Users who are viewing this thread

Top