src/Database/InOut/Mysql/Exporter.php
public static function fetch($tables)
    {
        foreach ($tables as $table) {
            $result = Driver::query("SELECT * FROM $table", Driver::INDEX);
            $fields = $result->columnCount();
            $rows = $result->rowCount();
            $data = Driver::read("SELECT * FROM $table", Driver::INDEX);
            //
            $content = (!isset($content) ? '' : $content).self::stucture($table);
            //

            $st_counter = 0;
            foreach ($data as $row) {
                if ($st_counter % 100 == 0 || $st_counter == 0) {
                    $content .= "\n-- Table Data\nINSERT INTO ".$table.' VALUES';
                }
                //
                $content .= "\n(";
                //
                for ($j = 0; $j < $fields; $j++) {
                    $row[$j] = str_replace("\n", '\\n', addslashes($row[$j]));
                    //
                    if (isset($row[$j])) {
                        if (!empty($row[$j])) {
                            $content .= '"'.$row[$j].'"';
                        } else {
                            $content .= 'NULL';
                        }
                    }
                    //
                    else {
                        $content .= '""';
                    }
                    //
                    if ($j < ($fields - 1)) {
                        $content .= ',';
                    }
                }
                //
                $content .= ')';
                //
                if ((($st_counter + 1) % 100 == 0 && $st_counter != 0) || $st_counter + 1 == $rows) {
                    $content .= ';';
                }
                //
                else {
                    $content .= ',';
                }
                //
                $st_counter = $st_counter + 1;
            }

            $content .= "\n\n\n";
        }

        return $content;
    }
public static function fetch($tables)
    {
        foreach ($tables as $table) {
            $result = Driver::query("SELECT * FROM $table", Driver::INDEX);
            $fields = $result->columnCount();
            $rows = $result->rowCount();
            $data = Driver::read("SELECT * FROM $table", Driver::INDEX);
            //
            $content = (!isset($content) ? '' : $content).self::stucture($table);
            //

            $st_counter = 0;
            foreach ($data as $row) {
                if ($st_counter % 100 == 0 || $st_counter == 0) {
                    $content .= "\n-- Table Data\nINSERT INTO ".$table.' VALUES';
                }
                //
                $content .= "\n(";
                //
                for ($j = 0; $j < $fields; $j++) {
                    $row[$j] = str_replace("\n", '\\n', addslashes($row[$j]));
                    //
                    if (isset($row[$j])) {
                        if (!empty($row[$j])) {
                            $content .= '"'.$row[$j].'"';
                        } else {
                            $content .= 'NULL';
                        }
                    }
                    //
                    else {
                        $content .= '""';
                    }
                    //
                    if ($j < ($fields - 1)) {
                        $content .= ',';
                    }
                }
                //
                $content .= ')';
                //
                if ((($st_counter + 1) % 100 == 0 && $st_counter != 0) || $st_counter + 1 == $rows) {
                    $content .= ';';
                }
                //
                else {
                    $content .= ',';
                }
                //
                $st_counter = $st_counter + 1;
            }

            $content .= "\n\n\n";
        }

        return $content;
    }
public static function fetch ( $ tables ) { foreach ( $ tables as $ table ) { $ result = Driver :: query ( "SELECT * FROM $table" , Driver :: INDEX ) ; $ fields = $ result -> columnCount ( ) ; $ rows = $ result -> rowCount ( ) ; $ data = Driver :: read ( "SELECT * FROM $table" , Driver :: INDEX ) ; // $ content = ( ! isset ( $ content ) ? '' : $ content ) . self :: stucture ( $ table ) ; // $ st_counter = 0 ; foreach ( $ data as $ row ) { if ( $ st_counter % 100 == 0 || $ st_counter == 0 ) { $ content .= "\n-- Table Data\nINSERT INTO " . $ table . ' VALUES' ; } // $ content .= "\n(" ; // for ( $ j = 0 ; $ j < $ fields ; $ j ++ ) { $ row [ $ j ] = str_replace ( "\n" , '\\n' , addslashes ( $ row [ $ j ] ) ) ; // if ( isset ( $ row [ $ j ] ) ) { if ( ! empty ( $ row [ $ j ] ) ) { $ content .= '"' . $ row [ $ j ] . '"' ; } else { $ content .= 'NULL' ; } } // else { $ content .= '""' ; } // if ( $ j < ( $ fields - 1 ) ) { $ content .= ',' ; } } // $ content .= ')' ; // if ( ( ( $ st_counter + 1 ) % 100 == 0 && $ st_counter != 0 ) || $ st_counter + 1 == $ rows ) { $ content .= ';' ; } // else { $ content .= ',' ; } // $ st_counter = $ st_counter + 1 ; } $ content .= "\n\n\n" ; } return $ content ; }
fetch data inside data tables.

@param array $tables tables of database

@return string
fetch data inside data tables .