mysql not inserting info
<p>The script below that I wrote won't insert field entry into the database or echo out the insert code. no errors are being shown the print_r($data) displays the csv entries in the files fine. it just won't insert or tell me why it wont</p>

<pre><code>     $handle = fopen($uploadcsv, 'r');
   $column_headers = array();
         $row_count = 0;
     $batchid = '0000';
     while (($data = fgetcsv($handle, 100000, ",")) !== FALSE) {
        if ($row_count==0){
                $column_headers = $data;
        } else {        

                if(file_exists('/home/domain/public_html/temp/files/'. $data[0] .'.doc')) {  
                    echo "running";             
                    $importword="INSERT into load_test(word, type, category, language, batch_id) 
                    values('$data[2]', '$data[3]', 'Class', '$data[4]', '$batchid')"; 
                    mysql_query($importword); //or die(mysql_error());

                    echo mysql_error();

                    $word_id = mysql_insert_id($importword);

                    $importwav="INSERT into names(com_id,rec_date,rec_time,rec_type,rec_request,rec_by,batch_id) 
                        values('$importword', '.date(d-M-y).', '.date('h:i:s a').', '$data[1]', '$data[2]', '$data[3]', '$data[4]', '$batchid')";

                    mysql_query($importwav); //or die(mysql_error());
                    echo mysql_error();
                        if(!is_dir("/home/domain/public_html/audio_rec/" . date(Y) . "/" . date(m) . "/" . $word_id)) {
                            mkdir("/home/domain/public_html/audio_rec/" . date(Y) . "/" . date(m) . "/" . $word_id, 0755, true);
                        }                       
                        rename($uploaddir . $data[0] .'.doc', $audiodir . date(Y) . '/' . date(m) . '/' . $word_id . '/' . $data[0] . '.doc');
                    }
                    print_r($data);
     }
     ++$row_count; 
</code></pre>
