No, PHP is not going to help if the data you want to put in the SQL data base conflicts with the table as established. If we had a better understanding of what you were doing we might be able to help more.
But it sounds like the data is not compatible with the table. Do you know what the table definitions are fror the rows, and which columns in the CSV are to be placed in which of the SQL columns? Perhaps a tweak of the CSV data would do what you need, i.e. add a unique key to the data.