T
T
tennessee_honey2018-01-28 23:02:29
Database
tennessee_honey, 2018-01-28 23:02:29

How to make sure that the site does not allow lines that were entered earlier (duplicate)?

There is a game site in which people enter certain combinations in two lines, and it is necessary to make it so that if the user enters this combination once, for example, 123 in the first line and 123 in the second, then the site will see this in the database, but when he does the second time, the site should not leave this duplicate in the database, that is, it should not allow the re-introduction of the same combinations, how to solve the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mertico, 2018-01-28
@Mertico

Check for existence or uniqueness in the database. Well, also store hashes, if the strings are long and you just need to check whether they entered this or not

Y
Yerlan Ibraev, 2018-01-29
@mad_nazgul

Maybe at the beginning of RTFM, otherwise it googles unique constraint

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question