Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 235 | Revision 237 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;

class convertDB extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'command:convertDB';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Converts the old webanOS-DB to laravel';

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $sql = '
            SELECT 
                *
            FROM
                directory
            WHERE
                father>=-1
        ';
        $pdo = DB::connection('old')->getPdo();
        $res = $pdo->query($sql);
        while ($row = $res->fetch_assoc()) {
            var_dump($row);
        }
    }
}