Show all database
$dblist =
DB::
select(
"SHOW DATABASES");
foreach($dblist as $db){
echo $db->Database; // Getn name of datatabse
}
Select specific db and show all tables of it db
use Illuminate\Support\Facades\DB;
DB::select("USE `mydb`");
$tables = DB::select('SHOW TABLES');
Select specific table
$data = DB::select("select * from tablename");
Comments
Post a Comment
If you any doubt of any topic then you can comment me.