title: Comparing array in PHP vs SQL database table
body: <p>I've been thinking for a long time but am not able to come up with an efficient solution. Currently, I have an array in PHP which is obtained by the user. It is an array of objects, and each object have 10 variables.</p>
  
  <p>I need to check if this array matches the data of the SQL EXACTLY, meaning that all the variables of each object must match each other. Index doesn't matter.</p>
  
  <p>1) How do I check? Right now the only way I can compare is the number of elements in array vs number of rows in database. If I want to check in-depth, do I really need to check variable by variable? Meaning if i have 10 objects, I need 10*10 variable checks?</p>
  
  <p>2)The only viable solution I can think of is erasing the database table and insert the object one by one according the array, but I'm worried if there is like 100 objects, won't it be too heavy for the sql database?</p>