0

I have a database with columns A, B, C, D, E, F

Now I'm trying to insert data from PHP into this database ONLY if the data doesn't already exist in A AND B AND E.

The data may be duplicated within columns many times but the same data in these 3 columns cannot be repeated.

How would I go about doing this?

Ali Irfan
  • 11
  • 4
  • 1
    many ways of doing this, did you try/search for anything? – Funk Forty Niner Oct 23 '15 at 18:42
  • and what have you tried? because Stackoverflow is not "give me" a code place – samayo Oct 23 '15 at 18:42
  • My current query is just: $sql = "INSERT INTO data (champ_id, items_bought, lane, match_id, tier, map_id, team_id) VALUES ('$championPlayed', '$listofitems', '$lane', '$matchIdArray[$i]', '$tier', '$mapId', '$teamID')"; However everything I've searched makes a column unique or only shows how to do this for one column. I need to only insert if it's unqiue in ALL 3 columns as the data may be repeated in one column and not the other. A,B,C,D,E was just a simplified version of my data. – Ali Irfan Oct 23 '15 at 18:43

0 Answers0