Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function import() {
- $templine = '';
- $lines = read_file(site_url('uploads/project.sql'));
- foreach ($lines as $line)
- {
- // echo $line;die();
- // Skip it if it's a comment
- if (substr($line, 0, 2) == '--' || $line == '')
- continue;
- // Add this line to the current templine we are creating
- $templine .= $line;
- // If it has a semicolon at the end, it's the end of the query so can process this templine
- if (substr(trim($line), -1, 1) == ';')
- {
- // Perform the query
- $this->db->query($templine);
- // Reset temp variable to empty
- $templine = '';
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement