douchun1948
douchun1948
2014-11-21 05:34

结果包含多行SQL = INSERT INTO

已采纳

While inserting first time it gives following error: "Result consisted of more than one row". When i try to insert record second time it gives error with message duplicate entry.

 SQL=INSERT INTO `master_user` (`name`,`user_name`,`email`,`password`,`system_name_of_friend`,`system_no_of_friend`,`registered_from_site`,`registered_on`,`is_existing_user`) VALUES ('FirstName LastName','username','demo@mail.com','8c71eede42e38709e9e836021b0b9b9b','','','site','','1')

any one help will be appropriated and following is the table structure which will be get help to tracking this issue very easily and get the solution for this.

CREATE TABLE IF NOT EXISTS `master_user` (
  `master_user_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `user_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `system_name_of_friend` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `system_no_of_friend` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `registered_from_ip` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `registered_from_site` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `registered_on` datetime DEFAULT NULL,
  `is_existing_user` bit(1) NOT NULL DEFAULT b'0',
  PRIMARY KEY (`master_user_id`),
  UNIQUE KEY `ukMasterUser_email` (`email`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1293 ;
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • duangang2825 duangang2825 7年前

    I have changed the few words from column Which are conflicting and resolved.

    点赞 评论 复制链接分享