May be this question was asked many times, but not working in my case.
Table Schema
CREATE TABLE `tasks_taskstatus` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(40) NOT NULL,
`video_status` tinyint(1) NOT NULL,
`creative_status` tinyint(1) NOT NULL DEFAULT '0',
`missing_asset` tinyint(1) NOT NULL,
`is_finished` tinyint(1) NOT NULL,
`share_with_am` tinyint(1) NOT NULL,
`ordering` smallint(6) NOT NULL,
`ready_to_begin` tinyint(1) NOT NULL,
`in_progress` tinyint(1) NOT NULL,
`is_conformed` tinyint(1) NOT NULL,
`order_item_equivalent` varchar(60) DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=122 DEFAULT CHARSET=latin1;
I need to insert a record in mysql database if it was not already exists, below is the query i was trying to use.
INSERT IGNORE INTO `tasks_taskstatus`
SET `name`='Saveout - In Progress',
`video_status`=1,
`creative_status`=0,
`missing_asset`=0,
`is_finished`=0,
`share_with_am`=0,
`ordering`=4,
`ready_to_begin`=0,
`in_progress`=1,
`is_conformed`=0,
`order_item_equivalent`='';
But everytime i run this query a new record was being created, so what's wrong in the above statement and how can i modify the above query in order to insert the data/record only if not exists?