Need to import data from csv to mysql db. The script should check if there any error before actually import anything to the mysql db. Most data should import to "Links" table. When Links table is being updated, the script should also update CatLinks table ([url removed, login to view] = [url removed, login to view] and get the CategoryID info from the catlinks field in the csv file). Please pay attention to MovieType field, the format in csv file is like type1##type2##type3 ...... but when it appear in mysql, it should look like: type1 type2 type3 I attached the db dump and sample data in this post. If you are interested, have a look and I think you will know what I mean.