I am trying to add data from the search form on the site to the mysql database.
Created a table
CREATE TABLE `dle_search` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `story` varchar(40) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=cp1251; It is added like this. Here $story is the data from the search form.
$db->query( "INSERT INTO " . PREFIX . "_search (story) values ('$story')" ); How to make it was not duplicate. It turns out
id | story 1 | текст 2 | текст 3 | текст According to the idea of id I don’t need it at all, but without it I didn’t work out so that I could delete these fields (1-2-3) separately.
story- duplicates cannot be added stupidly ... - Akinadle_searchCREATE TABLEdle_search(storyvarchar (40) NOT NULL AUTO_INCREMENT, PRIMARY KEY (story)) ENGINE = MyISAM DEFAULT CHARSET = cp1251; - steep