i am uploading data from a CSV file and its doing it properly.but the problem is i want to also insert the same data + some new values in the foreign key table which is failing. when i try to print the mysql_insert_id();it prints 0 even though it has taken the next autoincrement value.below is my code

$sql = "LOAD DATA INFILE '".@mysql_escape_string($this->file_name).
"' INTO TABLE `".$this->table_name.
"` FIELDS TERMINATED BY '".@mysql_escape_string($this->field_separate_char).
"' OPTIONALLY ENCLOSED BY '".@mysql_escape_string($this->field_enclose_char).
"' ESCAPED BY '".@mysql_escape_string($this->field_escape_char).
"' ".
($this->use_csv_header ? " IGNORE 1 LINES " : "")
."(`".implode("`,`", $this->arr_csv_columns)."`)";
$res = @mysql_query($sql);
$id = mysql_insert_id();
print "ID===".$id;
$this->error = mysql_error();

$this->Flag = "1";

Can any one help me how to do it...