20 | Connect to a Database From a Website Using PHP | 2023 | Learn PHP Full Course for Beginners

Поділитися
Вставка
  • Опубліковано 15 жов 2024
  • In this PHP tutorial I will teach you how to connect to a database using PDO, from a website using PHP! 🙂 Connecting to a database is necessary in order to query a database, so learning how to connect to it, is the first step to selecting and inserting data, directly from a website.
    ➤ GET ACCESS TO MY LESSON MATERIAL HERE!
    First of all, thank you for all the support you have given me!
    I am really glad to have such an awesome community on my channel. It motivates me to continue creating and uploading content! So thank you!
    I am now using Patreon and UA-cam Memberships to share improved and updated lesson material, and for a small fee you can access all the material either from my memberships or Patreon, depending on your preference. I have worked hard, and done my best to help you understand what I teach.
    I hope you will find it helpful :)
    Memberships: / @dani_krossing
    Patreon: / mmtuts

КОМЕНТАРІ • 76

  • @kasunkumarasinghe6365
    @kasunkumarasinghe6365 Рік тому +20

    There are so many videos on the internet. But you are the one who does it correctly.

  • @fangyiru8602
    @fangyiru8602 Рік тому +15

    thank you so much for doing this, you are so good at explaining things and honestly you are giving out so many practical scenarios that happens ALL THE TIME!! I learn so much from your videos and I will watch a lot of times to fully understand all. thank you Dani!!

  • @rodgence9641
    @rodgence9641 Рік тому +4

    I reaĺly like your tutorials its clean and straight forward, i started waching your tutorials 2yrs ago, pls make us upgrade to laravel even if it will be a paid course, i will appreciate that Dan.
    Africa is watching

  • @teddyYo-wf5oe
    @teddyYo-wf5oe 6 місяців тому +6

    I have seen all of 65 episodes of PHP I love it

  • @satishg6965
    @satishg6965 Рік тому +4

    this course is worth for $200, but im watching it for free, Thank you Dani!

  • @AViStudioMoldova
    @AViStudioMoldova Рік тому +7

    You're my mentor last 2 years! Right now i started to rebuild my old project in OOP mode, your lessons are right on time. Thanks!!!!

  • @davescorneroftheworld1147
    @davescorneroftheworld1147 Рік тому +6

    As always this video was jam packed with information. It will take some time to decipher all of it. THANK YOU!

  • @KAREKINFPV
    @KAREKINFPV 11 місяців тому +2

    I really like the flow of your videos, it's slow and methodical with plenty of explanation.

  • @sebeek00
    @sebeek00 11 місяців тому +38

    Man, first of all.. thank you for tutorials like this! But.. are you somehow related to Elon Musk?😂😂

    • @anasmazhar7942
      @anasmazhar7942 6 місяців тому +2

      More like Me Beast 😅

    • @anasmazhar7942
      @anasmazhar7942 6 місяців тому +3

      More like Mr Beast 😅

    • @siig9905
      @siig9905 4 місяці тому +1

      This was my first thought 😂

  • @zeppelin1qaz
    @zeppelin1qaz 8 місяців тому +2

    Excellent. Very clear explanation. Thenk you.

  • @igorstrzezysz9992
    @igorstrzezysz9992 11 місяців тому +1

    Man/bro thank you so mutch, I am working at this moment at PHP project on my University in Poland and I didn't know why my app doesn't work,ed as app, know is working thank you so mucth :)

  • @sampulcodemine
    @sampulcodemine Рік тому +4

    You are doing a great job Dani. Nice contents and nice way to break concepts into simpler ideas.

  • @katerinaproncheva2579
    @katerinaproncheva2579 7 місяців тому +2

    Very helpful and explanatory 👏🏻

  • @roninleo5679
    @roninleo5679 Рік тому +4

    Dani i love your content man i have learned a lot from you , can you start teaching laravel a little i want to upgrade to laravel framework and it will be so nice if you started an episode for teaching laravel

  • @akashgola2153
    @akashgola2153 7 місяців тому +2

    And Another informative session from Dani 😃.

  • @triumphadeniran7335
    @triumphadeniran7335 7 місяців тому +2

    Thank you so much this was really helpful

  • @rayfushgo
    @rayfushgo 9 місяців тому +2

    You are the best! Thank you!! ❤

  • @LiteralHatReloaded
    @LiteralHatReloaded 5 місяців тому +3

    LEGEND! THANK YOU!

  • @shahdhossam2221
    @shahdhossam2221 10 місяців тому +2

    wow ! It was the most informative videos I 've ever seen 😍😍

  • @montexart-og5hp
    @montexart-og5hp Рік тому

    you are doing a great job .plz never stop cz u helped mi a lot

  • @Boylagak
    @Boylagak Рік тому +3

    My favorite UA-cam channel. ❣️

  • @kaelthunderhoof5619
    @kaelthunderhoof5619 7 місяців тому

    I'm trying to make a salon reservation webpage, do I need an Index.html or should I only use php?

  • @samaugustinejunior5679
    @samaugustinejunior5679 4 місяці тому

    I have no errors now 😌 massive tutorials

  • @МирайМустафов
    @МирайМустафов 3 місяці тому +1

    appreciations my friend

  • @AA-fo4nd
    @AA-fo4nd 8 місяців тому

    I have question please answer me , if I use PDO extension Instead of mysqli , and use (mySQL) in mysqlworkbenck will it work?

  • @WillemsWimMH
    @WillemsWimMH 6 місяців тому

    Some question has been on my mind since a while as I am creating some system to record orders during a weekend of the sportsclub (not sure how you call it in English but with the sportsclub we have a 2-day event where we serve food). Anyway, I connect to the database as you do here. And also for the login form for the users (the people taking the orders) I do more or less the same as you do later in this course.
    Now I wonder, do you ever connect to the database with the specific user? Now we always connect with the root user and in fact we only check if the user logging in exists and uses the right password. But we never really connect to the database with that specific user, do we? Or do I misunderstand something?
    Thanks for giving this you view if and when you have some time.

  • @sonamohialdin3376
    @sonamohialdin3376 Рік тому +1

    Very useful tutorial thank you

  • @4n7h4r4x
    @4n7h4r4x 8 місяців тому +1

    bro ngl you look like elone musk , good video ❤

  • @moraaoo4889
    @moraaoo4889 Рік тому +2

    funny and simple, thank you bro 👌❤‍🔥

  • @aaronargottelopez3488
    @aaronargottelopez3488 3 місяці тому

    Thanks!

  • @hundesabwarkebaye
    @hundesabwarkebaye 4 місяці тому +1

    Great👍❗

  • @solaraproject3614
    @solaraproject3614 Рік тому

    I was like "Elon went back to coding?" You lowkey look like Elon Musk in some angles.
    Anyways. Thank you for this tutorial, youre a legend!

  • @berrykingdomiceberry6905
    @berrykingdomiceberry6905 Рік тому

    wonderful.
    please sir, how can I merge two or more database together, so they can fetch info from one database. example email, account, password etc.

  • @dave0
    @dave0 Рік тому

    Thank you so much!!!!

  • @angelmsigidi7806
    @angelmsigidi7806 Рік тому

    Thanks

  • @edmfestival1253
    @edmfestival1253 8 місяців тому

    Hello Dani - I am getting "Access Denied for user 'root'@localhost (using password:NO)" error. Not sure what am I missing. Can you please help me?

  • @ilovemusicchannel9191
    @ilovemusicchannel9191 6 місяців тому

    thanks, i spent lots of time to find the answer and it is here “Mac need to put root for the password” thanks again

  • @DenisRozon
    @DenisRozon Рік тому

    I am able to connect on my computer localhost to the dbase, but it does not seem to read the php code when I put it online to the public server , My php form is inside my index.php file What can be be the reason?

  • @MrAgentbozo
    @MrAgentbozo 4 місяці тому

    Love all the videos, however finding that for this one I'm getting this error "connection failed:sqlstate[hy000] [2002] no such file or directory". Works fine when running the php locally but not on replit.

  • @hanLi-mx6oy
    @hanLi-mx6oy 4 місяці тому

    I am want to be your student for get web developer in HTML and PHP and mysql , how much do need to spend per month ? i have bachelor dree of computer science, But i don't have a good skill in IT

    • @incredibleman2719
      @incredibleman2719 Місяць тому

      You can pay me, feel free to contact me. I will make you a professional developer in just three days.

  • @simplyb1178
    @simplyb1178 26 днів тому

    my holy savior

  • @zilingchen7004
    @zilingchen7004 11 місяців тому

    hi, i have face problem to show the input data in database can you help me to solve?

  • @osemekejoshua5287
    @osemekejoshua5287 Місяць тому

    Firstly thank you for this video but you didn’t do enough justice to the object classes as well as instantiate

  • @simoncastano_
    @simoncastano_ Рік тому +1

    How can I connect with other database? for example
    NoSQL databases mongodb, Postgres, firebase or something like that

    • @Boborjan1986
      @Boborjan1986 Рік тому +1

      At least postgresql would be a good addition to mention. Only mentioning two and one of them is rather a "wrapper" for others isnt sufficient. In my opinion.

  • @peaklegacy146
    @peaklegacy146 Рік тому

    Announcement! In Episode 21, we are shown how to change the username and password.

  • @guitarplayer1434
    @guitarplayer1434 Рік тому

    what database would I use to house videos ?

  • @OmaniProgrammer
    @OmaniProgrammer Рік тому

    Thank you brother can you make an oop project then anther laravel course

  • @Bikesandbmxgaming
    @Bikesandbmxgaming Рік тому

    What happened if wanted login page on same page as sig up could teacher me

  • @Noah-xn5th
    @Noah-xn5th 2 місяці тому

    why not use an actual server instead of xxamp?

  • @SalmanulFaris-zv6qy
    @SalmanulFaris-zv6qy 3 місяці тому

    do in mysqli also please

  • @omamowhophanuel6755
    @omamowhophanuel6755 4 місяці тому

    It feels like Elin Musk is teaching me PHP 🤯

  • @nemocedillo6185
    @nemocedillo6185 7 місяців тому

    6:33 (Bookmark)

  • @tyraelzumwraek937
    @tyraelzumwraek937 7 місяців тому +2

    This is PHP Musk 😂

  • @Epic_stickman90
    @Epic_stickman90 8 місяців тому

    I mean most times when there was an error it was just me, Not a single thing missed!

  • @kennieKE
    @kennieKE 4 місяці тому

    what if you are using html files

    • @Dani_Krossing
      @Dani_Krossing  4 місяці тому

      You convert them to PHP files, by simply changing the extensions

  • @waldoglas3412
    @waldoglas3412 Рік тому

    if you say in my last video please link it
    please

  • @ixL8d
    @ixL8d 2 місяці тому

    R+

  • @evansjosh7333
    @evansjosh7333 4 місяці тому

    dude is Elon Musk your brother? I saw in one video admit it that he is your relative

  • @andreitestmail
    @andreitestmail Рік тому

    nice script and 0 test if it works. video ended like DUNE movie.

    • @Dani_Krossing
      @Dani_Krossing  Рік тому +3

      You are so impatient 😅 The next few videos goes over how we can use the database connection

  • @jediampm
    @jediampm Рік тому

    HI, thanks for the video, however teaching or connect to DB with PDO without teaching the basic of OOP make no sense, sorry.

    • @chikomedia
      @chikomedia Рік тому

      you cannot be taught everything

  • @Po0pypoopy
    @Po0pypoopy 6 місяців тому

    WARNING to everyone!!.....he fails to mention anything about having to DOWNLOAD and install PDO...it was such a headache not knowing why my scripts weren't working as I copied exactly what he was doing but read up that PDO needs to be installed and actually "activated" within your php.ini file whenever you download php
    this is super confusing stuff as a beginner.....and not sure if he mentions any of this in other videos, but figured this comment would save others from a headache.

    • @Dani_Krossing
      @Dani_Krossing  6 місяців тому +1

      PDO isn’t deactivated by default. I’m not sure why yours was, but it’s not something people will need to activate first. 🤷‍♂️ Maybe you are using another server application than XAMPP?

    • @Po0pypoopy
      @Po0pypoopy 6 місяців тому +2

      @@Dani_Krossing I got php from the php website itself after following the w3schools link provided and noticed that non of my PDOs have an .dll ending after installing php. Also noticed that I don’t have a simple php.ini file but two : one php.ini.development(?) and the other with something else.
      I guess I will reinstall using xampp