--- If you never want to have duplicates, you should declare this as a table constraint: ---
CREATE TABLE bookmarks(
users_id INTEGER,
lessoninfo_id INTEGER,
UNIQUE(users_id, lessoninfo_id)
);
---(a primary key over both columns would have the same effect)
It is then possible to tell the database that you want to ignore if the insert didn't work---
INSERT OR IGNORE INTO bookmarks(users_id,lessoninfo_id) VALUES(123,456)