X
X
XenK2015-10-22 10:04:28
Phalcon
XenK, 2015-10-22 10:04:28

How to check if a row from a database is unique in Phalcon?

It is necessary to check the database row when inserting a new record for uniqueness, that is, so that there are no duplicates. What is the best way to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Tarara, 2016-09-07
@atarara

At the database level, create a unique index on the field

ALTER TABLE `table`
ADD UNIQUE INDEX `ix_phone` (`field`);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question