I've created a scraping script which every hour go through different articles and add them to a database. However in this database table i've set unique key on date and title, so it wont add the same articles over and over. This however seem to great a weird effect where the ids on the news auto increment id seem to count up even though the news is not added? How can i fix this?
$insert_news = $con->prepare("INSERT IGNORE INTO news (`title`, `url`, `image_url`, `date`, `news_text`, `website_id`) VALUES (?, ?, ?, ?, ?, 2)"); $insert_news->bind_param("sssss", $hltv_title, $hltv_link, $hltv_img, $hltv_date, $full_text_dont); $insert_news->execute();