How to connect to MySQL database with Laravel project

แชร์
ฝัง

ความคิดเห็น • 22

  • @nallawilljr.4873
    @nallawilljr.4873 ปีที่แล้ว +35

    Hidden code fix on line 13, timestamp [03:00]:
    echo "Successfully connected to DB and DB name is " . DB::connection()->getDatabaseName();

    • @joyzkieeeeeeeeeee7492
      @joyzkieeeeeeeeeee7492 10 หลายเดือนก่อน +1

      thank youuu

    • @Rijobin
      @Rijobin 9 หลายเดือนก่อน +1

      Thank you so much!

    • @mervey45
      @mervey45 8 หลายเดือนก่อน

      thank you soooooooo much

  • @Zleberc
    @Zleberc ปีที่แล้ว +26

    Do not recommend, the code is incomplete and not fully shown in the tutorial.

    • @musxsang
      @musxsang ปีที่แล้ว +1

      agreed

  • @gregjerry4110
    @gregjerry4110 8 หลายเดือนก่อน +1

    Thanks man was harving a hard time connecting mysql because the tutorial I was following was used sqlite

    • @techwebdocs
      @techwebdocs  8 หลายเดือนก่อน

      Glad it helped!

  • @sadge2836
    @sadge2836 ปีที่แล้ว +8

    use Illuminate\Support\Facades\DB;
    this line needs to be added before the If condition

  • @benjamimzeca5264
    @benjamimzeca5264 หลายเดือนก่อน

    Thanks a lot, this video helped me to fix some issue that i took more then 5hours

    • @techwebdocs
      @techwebdocs  หลายเดือนก่อน

      You're welcome!

  • @learnlab1229
    @learnlab1229 3 หลายเดือนก่อน

    kya is way sy migrations me table wali files create ho jay gee?

  • @Ankita_Informs
    @Ankita_Informs ปีที่แล้ว +4

    Having error of " could not find driver"

  • @tarciocavaleiro9095
    @tarciocavaleiro9095 5 หลายเดือนก่อน +1

    I'm having an "Undefined type 'DB' " error

    • @KwastStudio
      @KwastStudio 2 หลายเดือนก่อน +1

      this should fix it, and if you get
      SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydb.sessions' doesn't exist (Connection: mysql, SQL: select * from `sessions` where `id` = text tings limit 1)
      do php artisan migrate

  • @ubahobaah9706
    @ubahobaah9706 ปีที่แล้ว +1

    could not find driver error

  • @md.hasiburrahman9583
    @md.hasiburrahman9583 ปีที่แล้ว

    thanks brother love

  • @MethodsTech
    @MethodsTech ปีที่แล้ว

    Thanks