Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE `user_settings` (
- `userid` int(11) unsigned NOT NULL,
- `name` varchar(50) NOT NULL,
- `type` BOOL NOT NULL,
- `value_int` int(10) DEFAULT NULL,
- `value_str` varchar(100) DEFAULT NULL,
- PRIMARY KEY (`userid`, `name`)
- );
- #`userid`: The user that this setting applies to
- #`name`: The name of the setting
- #`type`: Tells you the set value is stored in `value_int` or `value_str`, (1 or 0, respectively)
- #`value_int`: Contains the value of the setting if type is 1
- #`value_str`: Contains the value of the setting if type is 0
- #Example of inserting settings
- #INSERT INTO user_settings (user_id, name, type, value_int) VALUES (1, 'fontsize', 1, 18) ON DUPLICATE KEY UPDATE value_int=65;
- #INSERT INTO user_settings (user_id, name, type, value_str) VALUES (1, 'fontcolor', 0, 'red') ON DUPLICATE KEY UPDATE value_str='red';
Add Comment
Please, Sign In to add comment