D
D
DEnisLEB2018-07-13 16:24:55
PHP
DEnisLEB, 2018-07-13 16:24:55

How can you test all arrays for common values?

There is a base
id = auto
idcontact1
idcontact2
status
It is necessary to display all records that have a pair according to this principle status = 1 and id (our = 2) is in both the first and second columns, and at the same time any id is in both line (if there is a pair according to this principle-> friends, there is no pair-> subscriber
5b48a77c49dff515564162.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Pitalenko, 2018-07-13
@Rikisan

SELECT * FROM TABLE WHILE (idcontact1 = 2 OR idcontact2 = 2) AND status = 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question