Laravel 8 tutorial - Multiple Database Connection

  Рет қаралды 28,299

Code Step By Step

Code Step By Step

Күн бұрын

Пікірлер: 37
@codestepbystep
@codestepbystep 2 жыл бұрын
Please support me by subscribe, like and comment :) thank you
@ektapatel_18
@ektapatel_18 3 жыл бұрын
Yes, it's possible as long as they are on the same server, for example: $result = \DB::table('db1. users') ->join('db2. users', 'db2.users.id', '=', 'db1.users.id') ->select('db1.users.id', 'db2.user.id');
@FarhanKhan-on9dc
@FarhanKhan-on9dc 2 жыл бұрын
well i guess thats not possible, your code wont work like this
@FarhanKhan-on9dc
@FarhanKhan-on9dc 2 жыл бұрын
also if iam wrong kindly perform it and show me a screenshot
@patitorodri
@patitorodri 8 ай бұрын
thanks man, really clear
@sandipbamaniya8559
@sandipbamaniya8559 Жыл бұрын
is it possible to connect live server database to local server like xampp?
@saikumarkandikonda431
@saikumarkandikonda431 3 жыл бұрын
yes joins can be applied on different databases as well
@tariqkhan5206
@tariqkhan5206 3 жыл бұрын
Yes it is possible just use the db name with both of the tables. Like: Return Model_name::join('db1.tablename', 'db2.tablename.id', '=' ,'db1.tablename.id') ->select('tablename.*) ->get();
@laibagillani2905
@laibagillani2905 3 жыл бұрын
SQL Server allows you to join tables from different databases as long as those databases are on the same server. The join syntax is the same; the only difference is that you must fully specify table names
@yulius4527
@yulius4527 2 жыл бұрын
so we can't join tables from another server ?
@DevsSebas
@DevsSebas 2 жыл бұрын
so good bro , but i need see the Divice model please(the estructure) thansk..
@skymatrix554
@skymatrix554 3 жыл бұрын
I am having ERP software in laravel,I have 100+database in it , each organisation have different database how to create 100+ database for ERP , any solution is having for this problem, please help me to solve this
@sonukumargupta5230
@sonukumargupta5230 Жыл бұрын
Thank You
@syedrizvi7455
@syedrizvi7455 4 жыл бұрын
JOIN can apply on tables with in the same DB
@manishakoladara8013
@manishakoladara8013 3 жыл бұрын
is this possible second connection from another server database?
@ahangkhaneh
@ahangkhaneh 3 жыл бұрын
Hey Anile. Can Laravel connect to two databases in different servers?
@codestepbystep
@codestepbystep 3 жыл бұрын
Yes
@ahangkhaneh
@ahangkhaneh 3 жыл бұрын
@@codestepbystep So How? Would you please explain or give me a reference to learn that?
@prachipandey8857
@prachipandey8857 3 жыл бұрын
@@codestepbystep same question sir❓?
@hariprasadhari5045
@hariprasadhari5045 4 жыл бұрын
I think that joins can only apply on same data base
@hariprasadhari5045
@hariprasadhari5045 4 жыл бұрын
if its wrong please replay me
@laxmankumarrawat5690
@laxmankumarrawat5690 3 жыл бұрын
@@hariprasadhari5045 Yes join two table on different database Model1::where('postID',$postID) ->join('database2.table2 as db2','Model1.id','=','db2.id') ->select(['Model1.*','db2.firstName','db2.lastName']) ->orderBy('score','desc') ->get();
@hirucci8986
@hirucci8986 3 жыл бұрын
Thanks a lot sir
@TusharZambare
@TusharZambare 2 жыл бұрын
but how to join databases tables 🤔 any solution
@aliefrahman694
@aliefrahman694 2 жыл бұрын
How to connect both mysql and sqlite?
@zoyamalik8738
@zoyamalik8738 2 жыл бұрын
Aik database ma agr multiple tables bna rahy hy to ksay kry gy
@eloircasas3827
@eloircasas3827 3 жыл бұрын
What if there is a different username on each database?
@mohamedanwar8165
@mohamedanwar8165 3 жыл бұрын
Thanks
@mitalgal7467
@mitalgal7467 2 жыл бұрын
Sir I’m not able to get data by using model
@atiqulislam2626
@atiqulislam2626 Жыл бұрын
Yes
@enas9895
@enas9895 2 жыл бұрын
there are many problems 1- create one migrations table for all databases not create one for each 2- any migration for any database add it in migrations table in mysql driver example (create table students in mysql2 migration recored in migrations table in mysql not mysql2 🙃 3- if you try build relation through another table belogns to different database driver not work 4- php artisan migrate:fresh give table exisits but not drop from second database
@SH-oe6vl
@SH-oe6vl 3 жыл бұрын
Call to undefined method Illuminate\Database\MySqlConnection::tabel() getting this error
@tariqkhan5206
@tariqkhan5206 3 жыл бұрын
It's table not tabel
@dannielmagano790
@dannielmagano790 4 жыл бұрын
Hi sir. I got an Error SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO) (SQL: select * from `users`)
@ahangkhaneh
@ahangkhaneh 3 жыл бұрын
Please answer my question.
@melaniefisher2653
@melaniefisher2653 2 жыл бұрын
Hello bro,can you open your telegram? I want to buy these tools.
@insightfulpod
@insightfulpod 2 жыл бұрын
Thank you
Laravel 8 tutorial - What is API | introduction
5:20
Code Step By Step
Рет қаралды 128 М.
Get Data From Multiple Databases In One Project | Laravel Tip
11:52
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 67 МЛН
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 74 МЛН
How to whistle ?? 😱😱
00:31
Tibo InShape
Рет қаралды 16 МЛН
Laravel 8 tutorial - Update Data in Database
10:42
Code Step By Step
Рет қаралды 68 М.
Laravel 8 tutorial - Http Request Methods
14:43
Code Step By Step
Рет қаралды 40 М.
Laravel: Multiple database connections
16:11
Kean Allen
Рет қаралды 1,4 М.
Laravel 11: Multi-Tenancy with Multiple Databases
8:23
Laravel Daily
Рет қаралды 19 М.
Laravel 8 tutorial - Http Client
11:32
Code Step By Step
Рет қаралды 53 М.
Laravel 8 REST API With Sanctum Authentication
54:13
Traversy Media
Рет қаралды 548 М.
Databases & Migrations | Laravel For Beginners | Learn Laravel
15:09
Code With Dary
Рет қаралды 53 М.
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 67 МЛН