This question already has an answer here:

How can I get the ID of the last file I just added to files?

'date' => date("Y-m-d"),
'name' => $name, );

$data2 = array( '%s', '%s' );

$this->wpdb->insert('files', $data, $data2); 

marked as duplicate by Community Apr 15 at 16:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.