I'm currently insert data by the way of using SELECT and not VALUES as it is by default. The problem is that I can't find a way to insert data only if it's not in the database.
This is my current query:
INSERT INTO collectives_users(id_user,id_artistname,id_collective,users_type,status)
SELECT
(SELECT id_user FROM artistnames WHERE artistname = 'yoannis'),
(SELECT id FROM artistnames WHERE artistname = 'yoannis'),
('1'),(2),(0)
UNION ALL
SELECT
(SELECT id_user FROM artistnames WHERE artistname = 'paul'),
(SELECT id FROM artistnames WHERE artistname = 'paul'),
('1'),(4),(0)
I tried with
INSERT IGNORE INTO
Doesn't work and not really appropriate (not returning error)
I also tried with
AND NOT EXIST
Doesn't work.
If you have an idea don't hesitate.