18: Apply The MVC Model Using OOP PHP | MVC Model Tutorial | Object Oriented PHP Tutorial

Поділитися
Вставка
  • Опубліковано 11 гру 2024

КОМЕНТАРІ • 315

  • @julesjacobs
    @julesjacobs 4 роки тому +64

    A lot of respect, I have watched all 18 episodes in 2 days and learned a lot. Thank you so much! You are a hero

    • @poutnik9001
      @poutnik9001 4 роки тому +5

      I have watched all 18 episodes in 2 hours 30 minutes

    • @TheXuism
      @TheXuism 3 роки тому

      @@poutnik9001 holycow!

    • @hamzatasc2068
      @hamzatasc2068 3 роки тому

      @@TheXuism exactly he is a great instructive.

    • @mauricemorty4687
      @mauricemorty4687 2 роки тому +9

      @@poutnik9001 and now you don't remember anything

    • @tomscambler
      @tomscambler 2 роки тому

      I second this

  • @gabrielfono844
    @gabrielfono844 3 роки тому +1

    I watched all your videos in two days.
    damn , as frontend engineer , I would say you are an expert in this field.
    many thanks
    love from seattle waghinston

  • @expressincorperated4439
    @expressincorperated4439 2 роки тому +5

    Lots and lots of respect. 18 episodes 5 days. I have never understood OOP concept until i came across your tutorials. Thank you.

  • @salmanmansoor1272
    @salmanmansoor1272 4 роки тому +12

    well i watched this series almost a year after it was uploaded and just wanted to say the it literally should have ended with this episode. i mean anyone who is watching a series on OOP PHP has to know procedural PHP and if anyone knows Procedural PHP its quite easy to figure out how to enter the data using froms. basically just create a process page in the root folder and go from index to process page taking all the variables to it through GET or preferably POST and then entering the variables inside the class methods like did on the index page. Thanks for this series. it was awesome

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

    I wish I saw this 4 years ago. I’m a self taught programmer and can make anything work and happen, but the bigger the project, I’ve tried to come up with my own ways of structuring everything, to no great avail. This series was super simple, great understandings, and funny too (like you popping out the side and fixing the typo as I’m reading the typo wondering if you’re gonna fix it 😂) I watched the whole series overnight and this morning. I searched for MVC, and got what I wanted. I’m glad you went through the whole process of different file definitions and states before just showing it all together, there was a lot of additional knowledge in this series that I didn’t know I needed. Thank you. 🙏 +subbed. P.s, I got excited when I saw you put “.” In to call a method in a class. I had hoped for a brief moment that you had revealed some sort of programming secret I dream of. Only to hear that your love of the “.” Came from “c#” also 😂

  • @TheKikkyx
    @TheKikkyx 5 років тому +36

    From all the mumbled information on the net, where people try to explain MVC through frameworks and libraries and other not known tools to newbies, this is wonderful explanation! Truly in simplest terms, love it!
    (And as some people said, can't wait to see how will you try to implement other important aspects and show people the wonderful (and chaotic) thing that is php :D )

    • @911madza
      @911madza 4 роки тому +3

      There are no chaotic languages.
      It's just your level of knowledge in core language itself and further ability to identify and apply the best practices in code structure/design patterns based on that.

  • @vadirajkanakagiri5028
    @vadirajkanakagiri5028 4 роки тому +34

    Legend has that Dani is still in process of uploading the next episode 😀

    • @acebishbi
      @acebishbi 4 роки тому

      hahaha, I think that is all and all we have to do is apply everything.

  • @bigdoggetom6549
    @bigdoggetom6549 3 роки тому +4

    After a good 6 months of procrastinating, I finally watched the last couple of videos. Fortunately I'm already versed in procedural PHP so it was easy to pick this up, but your teaching made it even easier
    Thank you for the effort put into this!

  • @roxanaion8930
    @roxanaion8930 4 роки тому +99

    Waiting for the next episode. Hopefully, it's going to be soon :D

    • @lucasbenavides1952
      @lucasbenavides1952 4 роки тому +8

      nop, Dani is busy uploading videogames
      no more php tutorials I'm afraid )-:

    • @arpanmaurya96
      @arpanmaurya96 4 роки тому +6

      we sort of have to move on to more consistent teachers because this guy left us in between i mean he does it good but there is no consistency

    • @kratom82
      @kratom82 4 роки тому +7

      @@arpanmaurya96 you probably have no idea what it takes to keep an course up to date, what time you have to invest and obviously you missed his mentionings that he is not just the teaching tuts guy..

    • @vlatkoviamkd
      @vlatkoviamkd 4 роки тому +2

      Dani has been re-making videos about Procedural PHP, I am sure as soon as he is done re-making those, he will continue doing OOP PHP.

    • @marcusaurelius8501
      @marcusaurelius8501 4 роки тому +5

      Hi I agree with above and below:Dani where is the next MVC episode? For me a form that works from index to your MVC structure will really help. I.e. a simple OOP CRUD that is 100% MVC compliant per last lesson OOP 18 will be awesomeness. I have been playing with other OOP cruds but they do not follow the MVC coding rules you stipulated. Hope you can do something for us soon. PS doesn't need to be fancy. Just tell us what we need to know and we will happily follow you as you work through it, accepting any issues as "par for the amazing course" ;~). Thanks. Mark.

  • @XJerome124
    @XJerome124 4 роки тому +1

    Thanks a lot Daniel, I went through this object oriented PHP playlist in January, I did not get most of it, then I tried other programming related things and I came and did all over again in December and understood everything smoothly, your teaching is top notch, sometimes we, the learners, are not really prepared enough for the content, thank you so much again, muchas gracias, regards from Colombia.

  • @Bonafide188
    @Bonafide188 4 роки тому +1

    I watched this series because I was trying to read the Laravel docs and kept coming across terms and concepts I did not understand. This series helped me fill all the gaps in my knowledge. From the bottom of my heart I appreciate this series. You are a great teacher

  • @Greg8872
    @Greg8872 4 роки тому +2

    @19:55 A good point to make of why you do this is that it decouples the Controller from the actual Model/Database. On the backend, if they decided to change it to use something other than a mySQL database, the model can be adjusted to handle the new data storage system, and the Controller never needs to know or ever updated. All it needs to know is that model has those methods available to it, what to pass, and what to expect back.

  • @renujadecosta6408
    @renujadecosta6408 5 років тому +6

    You are a life savior! You are one of the greatest teachers out there on the internet! You are amazing! Your lessons are so attractive and your way of presentation is..actually its that great I have no words to explain it..keep on doing these amazing lectures so that thousands..thousands of students out there will be helped in the future...

    • @stormybear4986
      @stormybear4986 4 роки тому +2

      I couldn't agree more! Dani is a consummate professional, he seems like avery charming gentleman and I enjoy his teaching style. His voice just makes me happy. Dani, jeg elsker deg!

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

    4 years ago, but still relevant, this is how a great teacher is! Thank you I understood all your content!

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

    Great content, I understand about 80% of everything. Only issue I've found is your Class auto loader doesn't work on Linux as Linux and Unix are case sensitive and windows isn't. So either have to modify the auto loader or name your class files of how you name your class in php. You have inspired me to stop what I'm doing now and rewrite all my code in OOP. My current Procedural code is very messy, especially since all my functions are written in a functions.php file.

  • @codeo4469
    @codeo4469 4 роки тому +2

    I've been looking for a good tutorial on OOP PHP for a long time now and I can easily say that this one is THE BEST!! All of the 18 videos were awesome and to the point. I sincerely hope that you will, someday, complete the tutorials here! Cheers mate, great job!

  • @ApteacherNetTelanganaTeachers
    @ApteacherNetTelanganaTeachers 3 роки тому +1

    Actually , I am Math Teacher from India... I am very interested in learning PHP... I viewed all ur PHP lessons ❤️❤️❤️❤️🙏🙏🙏... They way u explained is awesome 👍👍👍... Thq brother

  • @0Apostata0
    @0Apostata0 5 років тому +7

    This is great! I spent money on courses that are outdated and by far not as clean and simple. Great work! Love your videos, please keep it up! I am already thinking about becomming a patreon because the content is really great.

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

    Thank you, Daniel, for this course. It has a clear and simple, but safe and comprehensible structure that you teach us.

  • @user-bi7nq4nj7q
    @user-bi7nq4nj7q 3 роки тому +1

    Finally made it through all of the videos. Very well done. I was looking for something that would build my ability to understand the basics, to applying the MVC to use in a working environment. I didn't know where the lessons were going to take me, but I'm glad it gave me the EXACT tools to get me started. At this point I am capable of understanding say, Magento, for which I needed this knowledge. From here I am now able to understand the lessons being taught by Marko Shust to further my education on Magento. Im honestly glad I stumbled upon your lessons. I'll certainly recommend them to other junior devs like my little cousin! Thanks for making it enjoyable!

  • @afrobeatswithelixir8497
    @afrobeatswithelixir8497 3 роки тому

    You're a great tutor Daniel. Your channel should be recommended for universities

  • @ademineshat
    @ademineshat 5 років тому +12

    Like allways very clever.
    It's a good idea always to apply what we have learned, in some mini app with MVC. I'm seriously learning the mvc now, i bought some books, I watch your channel:)
    So please consider making a dummy app just to see how we apply the mvc model in real life.
    Thank you

  • @timelord3420
    @timelord3420 4 роки тому

    Yeah... I had to stop the video, rewind , watch again and then stop the video and watch again this time with subtitels on.
    Oh, don't get me wrong, your explanations are great. I just need time to digest them. ;)
    Kudos!!!

  • @bhgur84
    @bhgur84 3 роки тому +1

    Hey Daniel
    I really enjoyed this tutorial just like all the other ones before. I started with CSS and HTML, the procedural PHP course and now this PHP OOP. Great last tutorial on the MVC Framework. Like many others I am also disappointed with the fact there will be no final episode. Too bad because it would really be the cherry on the cake. Don't get me wrong because I also understand of your point of view you have decided to put your energie in other projects. So why am I writing this........well just to say thank you again and hopefully this message and the messages from other followers do inspire you to make a last episode to close off this tutorial.

  • @flightlessbird9334
    @flightlessbird9334 4 роки тому +2

    Hi I love all your tutorials and they help me so much alongside my studies to become a developer.
    I just wanted to point out a tiny little thing that you might want to include in the future to avoid confusion, regarding the file naming and the autoloader. While this code works fine on a Windows based system where file names are not case sensitive, but when you are on a Linux based system (not sure for Mac) it will lead to an error message when you write the classes capitalized but the file names in lowercase. Just letting you know in case you want to include that in future episodes.
    But anyways I really enjoy your videos and appreciate the hard work you put in :)

  • @lawrencemichael5571
    @lawrencemichael5571 4 роки тому

    Made it here from episode 1 of the procedural PHP course.
    Awesome teacher
    Awesome course
    I can't wait for the next episode!
    God Bless you Daniel! Thank you so much!

  • @hayatzee8830
    @hayatzee8830 2 роки тому

    Amazing explanation of the MVC model, please don't stop teaching!

  • @RobotsAndMagicPowers
    @RobotsAndMagicPowers 4 роки тому

    I think you have explained all this way better than any other videos i have watched! I finally understand! Thank you so much. I did notice that I can't seem to find the video explaining the last part of this on how to submit a form and then do all of this. I can probably google that though :D

  • @fatemen3764
    @fatemen3764 3 роки тому

    i am waiting for next one .you are the best teacher i ever had .tnx

  • @mohammedshahidrahman8276
    @mohammedshahidrahman8276 4 роки тому +2

    Wonderful tutorial....waiting for episode 19....nicely explained the concept of MVC without any framework.....not many ppl do that....
    One request...plz upload a real life project....like a basic cms or photo gallery.... thnx

  • @wilwad
    @wilwad 2 роки тому

    14:06 You can pull the key values dynamically from an assoc array. If you hard code them then you need to update the code whenever you change the column names in the DB

    • @Liloz01
      @Liloz01 2 роки тому

      How would you do this?

  • @chrislyonm
    @chrislyonm 3 роки тому

    Absolutely loved your explanation of MVC architecture in PHP.
    I noticed it's been a while since this last video has been uploaded, but I can't wait until you have time to get back to it!

  • @M45963
    @M45963 3 роки тому

    Thank you for the whole tutorial, I know it requieres a lot of time (defining the content, recording and then editing), so thank you for all of your effort.
    Only if it's possible, please create a final episode with the "submit form" to close this tutorial, it would be perfect !!
    Have a good day.

  • @trangminh4055
    @trangminh4055 4 роки тому

    I am feeling sad for me. I have came to this lessons so far bro :( . Honestly, I wish you best luck with your dreams after watching 2020 changes. But if you wanna come back to teach us as you did, please at least complete this lesson :). You inspired a lot of students, brought us to the world of coding as easy as possible. Thank you mmtuts! With love from Viet Nam.

  • @davidma4855
    @davidma4855 2 роки тому

    Wow your explanation is so clear. So many concept you've successfully simplify without sacrificing the actual functionality. I'm definitely rooting for you :)👏👏

  • @MohammedAli-yx7nz
    @MohammedAli-yx7nz 5 років тому +1

    Thank you so much, your php tutorial is the best and it's very easy to understand, i am very excited to check your other tutorials. Wish you all the best.

  • @-dinkadink6735
    @-dinkadink6735 5 років тому

    dear mmuts i would like to tell you you that you are my hero. You are helping me alot.thank you my hero.
    yenurilej from ethiopia!

    • @bereketababu9705
      @bereketababu9705 4 роки тому

      hello yasin should i start this course i am from ethiopia too.

  • @emisamad302
    @emisamad302 4 роки тому +1

    Thank you very much for making this tutorial. You're a very good teacher, indeed. For the next topic, I hope you might consider to explain about CSRF attack and how to avoid it as well.

  • @normanlove222
    @normanlove222 2 роки тому

    Thanks for the OOP Episodes Dani. I am grateful I got to watch them and learn. I will check out your game Dev stuff soon. Blessings 🙏

  • @simonecotena325
    @simonecotena325 3 роки тому

    Great maybe the best php tutorial on youtube. I hope you will continue!

  • @liyuxi9481
    @liyuxi9481 4 роки тому

    the best php tutorial I've ever watched

  • @JairEmanuels
    @JairEmanuels 10 місяців тому +1

    Respect for teaching a lot of great lessons while being CEO of SpaceEx and Tesla at the same time.

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

      😂 liked this one. Usually I just get “you look like Elon Musk”.

    • @JairEmanuels
      @JairEmanuels 10 місяців тому +1

      Hahaha but seriously, the content is very helpful. Thanks!

  • @riazahmadshigri8814
    @riazahmadshigri8814 4 роки тому

    one of the best vedio i have ever seen specially interface episode thanks and please start a complete project using oop php

  • @bartoszbednarek7106
    @bartoszbednarek7106 5 років тому +44

    When will you upload next MVC video?

  • @thelostrider1
    @thelostrider1 3 роки тому

    Amazing series! If he actually makes a real project/website (like an e-commerce) I bet beginners would learn a lot.

  • @sabbirahamed7050
    @sabbirahamed7050 3 роки тому

    May Allah illuminate you with Hidaya and give Jannah. I will pay you one day for all of these free php tutorials, if I can earn using php, Inn sha Alloh !!

  • @jameswill2334
    @jameswill2334 4 роки тому

    Great job Dani , Thanks for sharing this OOP PHP tutorial & keep continuing.

  • @zebagul5884
    @zebagul5884 4 роки тому

    Wonderful tutorial for the beginners like me .... waiting for the next class 😊

  • @priorityyouth
    @priorityyouth 3 роки тому +1

    I have been watching the 18 episodes over and over now. I have really had my knowledge of php enhanced. When is the next episode coming? :D
    any recommendations on other channels as good as this guy??? Will appreciate a quick response

  • @asifurrahman5436
    @asifurrahman5436 2 роки тому

    Thank you so much for your comprehensive tutorial

  • @nsourward
    @nsourward 4 роки тому +1

    2020 PLEASE where are the next episode :"( you are my only HOPE!
    THANK YOU SO MUCH you saved my life!

  • @AlbertoRivas13
    @AlbertoRivas13 4 роки тому +2

    This is so cool, I feel like a pro developer haha

  • @a.m.azimsarkar2448
    @a.m.azimsarkar2448 4 роки тому

    Really you are programming boss...lot of thanks boss

  • @jacksons8032
    @jacksons8032 4 роки тому

    You have the best tutorials ever!

  • @dennismatsson9995
    @dennismatsson9995 3 роки тому

    These videos are great. Great explanation and great quality! Good job! Also like how there was a guy with my name and same year of birth hehe

  • @ryanleber
    @ryanleber 4 роки тому +1

    This is super helpful. I'd love to see this programming approach used with AJAX, to make an interactive site that doesn't require page refreshes. This video's super helpful for figuring out this MVC stuff, but I still feel like I'm missing something to bridge this approach to an AJAX approach.

  • @ucodetech9795
    @ucodetech9795 4 роки тому

    You are doing great bro, i have learnt alot form you

  • @henryho952
    @henryho952 4 роки тому

    I've been waiting for the new episode sir Daniel! thankyou!

  • @destinyobamwonyi2037
    @destinyobamwonyi2037 3 роки тому

    We are all waiting for the next episode , Thanks a lot though .

  • @ernestofavio6735
    @ernestofavio6735 3 роки тому

    Thanks bro, pls continuous this series

  • @marco114
    @marco114 4 роки тому

    Well, now I am going to go back to try learning Laravel because I didn't fully understand OOP and MVC. Let's see how well he teaches!

  • @rezadizaji8780
    @rezadizaji8780 4 роки тому

    The tutorial isn't complete without that last episode you mentioned, because it's unclear how to actually use the learnings.
    I should figure it out myself or look elsewhere to find the actual usage solution.
    But anyway it helped a lot, thank you so much.

  • @stefan4800
    @stefan4800 4 роки тому +1

    This example is actually breaking the rules of MVC architecture. View in MVC is an actual HTML, which shouldn't talk with the model directly, but through the controller which is there to serve as an intermediary between the view and the model. That being said, UsersView class in this example is redundant, because it's doing the role of the controller.

    • @Dani_Krossing
      @Dani_Krossing  4 роки тому

      I address your comment in one of the first videos in my course :)

  • @sohbetmuhammetgeldinazarow4110
    @sohbetmuhammetgeldinazarow4110 2 роки тому

    Great tutorial.I think you also need to add here a small video explaining traits too.

  • @MrDeano2506
    @MrDeano2506 4 роки тому +1

    Like everyone has said here you're an amazing teacher but are you planning on finishing the series?? Much love and hope you're well.

  • @danielwise6103
    @danielwise6103 3 роки тому

    I have been waiting for the next episode for the longest time now. please do something.

  • @natnaelalemayehu9112
    @natnaelalemayehu9112 4 роки тому +3

    For any one asking when the next episode will come out, even though the next episode might not come out from mmtuts soon, you can easily catch up this course with a video from netnija. He goes over form handling oop php. so check out the video here ua-cam.com/video/Hs5m2jLw7_A/v-deo.html

  • @savilboy7269
    @savilboy7269 4 роки тому

    The best like always! Open your bootcamp.

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

    Yay, finally done. Thank you Dani!

  • @Rafael-es5dp
    @Rafael-es5dp 4 роки тому

    You are the best. I just wonder if you are going to do the next episode? I am really sorry for being selfish sir. I just want to fully understand this method and having that next episode will be great.

  • @alonsoquinones6979
    @alonsoquinones6979 4 роки тому +2

    Great video, really enjoyed it! So this is the final episode 18 of this series, and you are talking about the "next episode". Which one is that. Curious about the "form" part.

  • @panoramastreettour
    @panoramastreettour 3 роки тому +1

    Thank you so much for the information. :)

  • @bogdansvideos
    @bogdansvideos 4 роки тому

    18:45 how will affect security if you change from protected to public the "setUser" method and refer to it directly in index page?

  • @DereckNoom
    @DereckNoom 5 років тому

    Thank you very much! I have actually used fetch() instead of fetchAll(), I was getting a nested array.. I user my own database. print_r($results) gives you the exact array you're trying to retrieve from the database.

  • @johnnguyen1655
    @johnnguyen1655 4 роки тому

    Great tutorials Daniel. Keep it up! Thanks

  • @ocasja
    @ocasja 5 років тому +4

    Would you do a image gallery with the MVC framework?

    • @always12lovemusic
      @always12lovemusic 4 роки тому

      from what I understand of MVC, this framework requires input from the user that is then given to the Model via the Controller and manipulated before being given back to the user in the View. As there is no need for user input or manipulation of data with an image gallery I would say no. Interested to hear what other people think..

  • @sliceem88
    @sliceem88 4 роки тому

    Thank you so much for your php tutorial , they are Best !

  • @mohitkumbhare1491
    @mohitkumbhare1491 4 роки тому

    thank you Daniel..waiting for 19th episode

  • @americosdias
    @americosdias 3 роки тому

    Hi Dani,
    Thanks a lot. Fantastic work!

  • @abu-hashmah
    @abu-hashmah 4 роки тому

    Eagerly waiting for the next episodes...😀

  • @robustreviews
    @robustreviews 3 роки тому

    Any tips for handling the mysql WHILE loop in the MVC model?
    For example I want to run a "SELECT *" where I'll return many results in the model and display them in the view, I can't work out how to do it though.

  • @JamesAutoDude
    @JamesAutoDude 3 роки тому

    How do you handle blank submissions for updating?
    Like let's say the form has all 3 fields to update info with, but the user skips the birthday field, is there a way that the statement would know it was skipped and to apply it to the correct spot in the database? 🤔🤔

  • @ernestopokuagyemang9877
    @ernestopokuagyemang9877 5 років тому +1

    Been waiting for this

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

    You the best at least for me thank you very much

  • @soja2897
    @soja2897 3 роки тому

    Waiting for the next episode!!!

  • @turbosardar39
    @turbosardar39 4 роки тому +1

    Don't you think getUsers() should be inside controller?

  • @jamesarvinrozul8293
    @jamesarvinrozul8293 4 роки тому

    Thank you for this tutorial! I'm waiting for your next video.

  • @andyvonm.simbajon1944
    @andyvonm.simbajon1944 Рік тому

    Well explained ! Thankyou

  • @mikekonig3307
    @mikekonig3307 3 роки тому

    @Dani Krossing I'm actually started learning PHP a couple months ago, now I got to that point I watched all of your videos and ask myself the exact question you said in that video. I really got lost to continue because nobody explains it as good as YOU do soo pllllssss I beg you. When is the next episode going to come out XDXDXD I nnneeeedddd helpXD

  • @nirajgurung8348
    @nirajgurung8348 4 роки тому

    Thank you and please post the next tutorial soon :)

  • @ivansafronov3359
    @ivansafronov3359 4 роки тому

    Please continue your PHP videos! Believe u!

  • @muhammadfathurrahman1186
    @muhammadfathurrahman1186 4 роки тому +1

    im wating for the next episode

  • @amribrahim8818
    @amribrahim8818 3 роки тому

    thank you very much
    that was really helpful

  • @jobdoliguez7803
    @jobdoliguez7803 5 років тому +1

    its pretty cool and well said.. can i ask you something? can you upload a video using frameworks like codeigniter etc. thanks a lot sir your tutorials are very helpful for us .. keep it up!

  • @madhushaniperera7199
    @madhushaniperera7199 5 років тому

    Hiii...😊😊
    I wanted to thank you cos you saved my life💚
    I even tried to message you on twitter 😓 to thank you personaly,
    but messaging function was desabled😭
    So here I am..you are a life server..
    Thank you very very ~~ much..🤗😊🤩
    ..........
    This is about "The login system tut🤩🤗"
    Love from 🇱🇰 ❤

  • @SiriusPhil
    @SiriusPhil 3 роки тому

    I once feared learning MVC. You made is simple to understand. Is there a lesson #19?

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

    Thx, I got the basics.

  • @emilsamsarov2302
    @emilsamsarov2302 4 роки тому

    To handle form we can add to files in includes folder - login.inc.php and register.inc.php

  • @kicksme8184
    @kicksme8184 2 роки тому

    Hi guy!
    I followed all your steps but but didn't work for me while calling or creating the instance obj ($obj = new UserModel();
    Fatal error: Uncaught Error: Class 'Dbh' not found in C:\xampp\htdocs\mvcphp\Classes\user.class.php:2 Stack trace: #0 C:\xampp\htdocs\mvcphp\Views\user.view.php(4): include() #1 {main} thrown in C:\xampp\htdocs\mvcphp\Classes\user.class.php on line 2

  • @arshiatolou1958
    @arshiatolou1958 2 роки тому +1

    Tysm perfect tutorial! but i've got a question? So in the ShowUser() method why did we put this [0] before Column name. To be clear you wrote $results[0]['first_name']. what's the reason behind that [0] thing. I actually wrote the same code without [0] and the browser threw me an error. i'm a little bit confused here sir could you explain please?

    • @Dani_Krossing
      @Dani_Krossing  2 роки тому +2

      It's because we grab the data as a multidimensional array. 🙂 Which means "an array inside an array". The reason we receive it as a multidimensional array, is because we in some cases might wanna get data from multiple rows in our database. But in this case here we just needed 1 row, which meant we didn't get further than [0].

    • @arshiatolou1958
      @arshiatolou1958 2 роки тому

      @@Dani_Krossing Oh i see! I truly appreciate your response

    • @hayatzee8830
      @hayatzee8830 2 роки тому

      Thank you Arshia, I had the exact same question.

    • @arshiatolou1958
      @arshiatolou1958 2 роки тому

      @@hayatzee8830 🤝🏻