I need to be able to run all of the following within a single call of a query using mysqli-> multi_query, so this is complicated. I have a table consisting of the following columns:
- ID
- Email
- event_promo_code
- event_id
When the script starts, I need to be able to insert new lines or an UPDATE line if both idAND event_idmatch the existing record (not just one key or the other).
Now I have:
INSERT INTO `rsvps`
SET id='$rsvpID', email='$rsvpEmail',
event_promo_code='$rsvpEventCode', event_id='$eventID'
ON DUPLICATE KEY UPDATE id='$rsvpID',
email='$rsvpEmail', event_promo_code='$rsvpEventCode', event_id='$eventID';
id - . event_id , , , , , BOTH .