I'm doing an import function for .sql files. I tried following the steps given in this link http://ellislab.com/forums/viewthread/151225/#733423 but I keep getting the "Query was empty" error.
This is my code:
// I'm moving the uploaded file to a folder named 'path' and try to load it there.
$file = $_FILES['file']['name'];
$file_path = './path/';
move_uploaded_file($_FILES['file']['tmp_name'], $file_path.$file);
$file = $this->load->file($file_path.$file, true);
$file_array = explode(';', $file);
foreach($file_array as $query) {
$this->db->query("SET FOREIGN_KEY_CHECKS = 0");
$this->db->query($query);
$this->db->query("SET FOREIGN_KEY_CHECKS = 1");
}
After executing the function, I get the error but the data were successfully inserted to the database. I can't seem to find what's wrong here. Please help me.