I am importing a csv file into a database. Finally got that done and as you all know... That is when the boss throws a monkey wrench into the works.
Now I have added a status field. This means that I have to allow the same files to be inserted. The first time the person is inserted to the database they are a trial customer... with a status of 2.....
When they pay they are upgraded to a status of 1. I would like to be able to do this from the same upload... What I have done is used a checkbox.
If checked then the customer is a trial customer.
If not checked the customer is a regular paid customer.
I then put an if statement..
If (trial == trialcust){
$status = 2;
}
else{
$status =1;
}
Then I have all the code to dedupe the database...
when I get to the insert I need to be able to insert new customers and still update existing customers...
My boss is using an older version of mysql so I cant use the
ON DUPLICATE KEY UPDATE function
Any ideas on how to do this on an older version of mysql?