Search code examples
apache2mysql-error-1054

Error 1054 on unused index in insertion


Unknown column 'timestamp' in 'where clause'

INSERT INTO `users` (`name`, `username`, `password`, `email`, `mobile`, `passout`, `Batch`) 
VALUES ('ABC', '12141000', '4a7d1ed414474e4033ac29ccb8653d9b', '[email protected]', '88xxxxx', '2020', 'CS')

DB:

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(12) NOT NULL,
  `name` varchar(25) NOT NULL,
  `password` varchar(48) NOT NULL,
  `email` varchar(25) NOT NULL,
  `mobile` varchar(10) NOT NULL,
  `passout` char(4) NOT NULL,
  `Batch` enum('CS','EC','EE','others') NOT NULL,
  `examcode` int(11) NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;

Data Insertion Code:


Solution

  • Sorry it was my mistake, my trigger was on which calls the column name 'timestamp'.. visibly there is no where clause which made me confused...