Welcome Guest, Not a member yet? Register   Sign In
Export DB to sql file
#1

[eluser]Unknown[/eluser]
This is a library class to export structure as well as data from tables also export complete db in sql file.

The implementation is very simple. Example implementation is below:

Code:
// Load Export sql library
$this->load->library('export_sql');
//  Add where clause
        $where = array(
            'id' => 123,
        );

        //  Create list of tables to be exported.
        //  Mark whether to dump data as true/false
        //  By default its false.
        $tables = array(
            'table1'        => TRUE,
            'table2'     => TRUE,
        );

        $this->export_sql->export($tables, $where, FALSE); // If true is provided for the last argument, it will export full DB.

Place the attached library file in you application libraries directory

./application/libraries/

Feel free to let me know your comments.


Messages In This Thread
Export DB to sql file - by El Forum - 05-16-2011, 02:40 AM
Export DB to sql file - by El Forum - 05-16-2011, 04:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB