MySQL Forums
Forum List  »  Russian

Помогите с запросом
Posted by: Denis Kolov
Date: May 07, 2009 09:09AM

CREATE TABLE IF NOT EXISTS `users` (
`uid` bigint(20) unsigned NOT NULL,
`username` varchar(64) COLLATE utf8_bin NOT NULL,
`password` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT '*',
`auth_info` varchar(64) COLLATE utf8_bin NOT NULL,
`auth_type` tinyint(1) NOT NULL COMMENT 'тип проверки',
`active` varchar(254) COLLATE utf8_bin NOT NULL COMMENT 'активен',
`user_ip` varchar(16) COLLATE utf8_bin NOT NULL COMMENT 'ip юзера',
`user_mac` varchar(18) COLLATE utf8_bin NOT NULL COMMENT 'mac юзера',
PRIMARY KEY (`uid`),
KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='пользователи';

Как сделать выборку в одном запролсе, если:
auth_type = 0 то выбирать только из полей username, password
auth_type = 1 то выбирать username,password,user_ip

Options: ReplyQuote


Subject
Views
Written By
Posted
Помогите с запросом
4381
May 07, 2009 09:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.