nadiam 0 Posting Pro in Training

hey guys so ive been asked to add an import csv function to my contacts page.

<?php  

require "connection.php";

if ($_FILES[csv][size] > 0) { 

    //get the csv file 
    $file = $_FILES[csv][tmp_name]; 
    $handle = fopen($file,"r"); 

        if ($data[0]) { 
            mysql_query("INSERT INTO contact (fname,lname,email) VALUES 
                ( 
                    '".addslashes($data[0])."', 
                    '".addslashes($data[1])."', 
                    '".addslashes($data[2])."' 
                ) 
            "); 
        } 
    } while ($data = fgetcsv($handle,1000,",","'")); 

} 

?>

i found this coding on the net and just want some clarification.

  1. if($data[0]) checks if the first "column" of a csv file exists?
  2. stumbled on a site that said addslashes isnt good but did not elaborat. why isnt it good?
  3. say my first column is id and its auto-increment do i add column id in the insert query? -> contact (id,fname,lname,email)
  4. what if the csv file has header? how to code to check if theres header and if there is ignore the header.
  5. whats the 1000 in the fgetcsv($handle,1000,",","'"))?

    thanks in advance!