选择有效并返回 1 个结果。
SELECT * FROM `list` WHERE `email` = 'john@doe.com' AND `cid` = 1;
此更新有效,没有错误,没有记录受影响!!!
UPDATE `list`
SET `message` = 'test', `status` = 0
WHERE `email` = 'john@doe.com' AND `cid` = 1;
表结构
CREATE TABLE `list` (
`id` BIGINT(19) NOT NULL AUTO_INCREMENT,
`email` VARCHAR(255) NULL DEFAULT NULL,
`cid` INT(10) NOT NULL DEFAULT '0',
`message` TEXT NULL,
`date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`status` TINYINT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
INDEX `cid` (`cid`),
INDEX `date` (`date`),
INDEX `status` (`status`)
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM;