I am working on a database project. I can successfully read an event XML feed from another website and place it into the database (via php).
internal_id
is controlled by me and needed externalinstance_id
is pulled from the feed and I want to insert it if it does not exist.
I am trying to achieve that the events have their own eventinstance_id
(I want to use this to insert only unique), and I have my own internal_id
. How do I "insert if external_id
is not in the database" (ignore duplicated)?
I have tried to use a select where not exists in phpmyadmin (trying to build the query), however, when I perform the query I get this SQL syntax error on phpmyadmin:
I want to insert if there isn't a internal_id
of 2 for example.
I'm using:
- Win 7
- Apache 2.4.18
- PHP 7.0.6
- PHP EXT mysqli
- phpmyadmin 4.5.1