Welcome Guest, Not a member yet? Register   Sign In
Run Microsoft .SQL within CI Model
#2

[eluser]Ben Bowler[/eluser]
If anyone's interested I slept on it and came up with this ridiculously simple function:

Code:
/**
*
* Retrieve the results of an SQL file
*
*/

    function runsql($file = '')
    {
        
        $this->db_download = $this->load->database('download', TRUE);
        
        $sql = file_get_contents($file);
        
        $query = $this->db_download->query($sql);
        $result = $query->result();
        
        return $result;
        
    }


Messages In This Thread
Run Microsoft .SQL within CI Model - by El Forum - 03-22-2011, 11:30 AM
Run Microsoft .SQL within CI Model - by El Forum - 03-23-2011, 05:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB