20.11.2016, 02:19
Alright so I am trying to do some queries with on duplicate key update but seems that i've either set up my DB wrongly or my query, its been a long day so I'm just sitting around bashing my head trying to figure out
PS: No errors inside the mysql log. Query gets executed correctly, altho it doesnt insert anything and I have an empty table sitting.
Query
Tldr, problem? It doesnt insert anything eventho according to MySQL log its executed correctly.
PS: No errors inside the mysql log. Query gets executed correctly, altho it doesnt insert anything and I have an empty table sitting.
Query
pawn Код:
"INSERT INTO commands (`command_name`,`command_power`,`author`,`patch`) VALUES ('%e',%i,'%e','%e') ON DUPLICATE KEY UPDATE `command_name`='%e'",cmd_name, power, author, patch,cmd_name
PHP код:
CREATE TABLE `commands` (
`ID` int(10) NOT NULL,
`command_name` varchar(128) NOT NULL,
`command_power` int(10) NOT NULL,
`author` varchar(64) NOT NULL,
`patch` varchar(128) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `commands`
--
ALTER TABLE `commands`
ADD PRIMARY KEY (`ID`),
ADD UNIQUE KEY `command_name` (`command_name`);