Create a PHP Application | PHP MVC Project Tutorial

  Рет қаралды 50,684

Dave Gray

Dave Gray

Күн бұрын

Пікірлер: 85
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
This tutorial creates a PHP Assignment Tracker application from scratch using the Model-View-Controller design pattern. It also shows how to work with two MySQL database tables linked by a foreign key. After completing this tutorial, consider expanding the application by adding due dates or other ways to prioritize assignments. Check out my full PHP playlist here: kzbin.info/aero/PL0Zuz27SZ-6MeRUt-z60DRxNqcrFAUYIb
@ferenc3460
@ferenc3460 3 жыл бұрын
Hey Dave! Great tutorial! Is it possible to some familiar project but with sessions and file upload in MVC? Thank you in advance :)
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
@@ferenc3460 yes it is. 😃 Thanks for the request! 💯
@ferenc3460
@ferenc3460 3 жыл бұрын
@@DaveGrayTeachesCode wow, such a fast response! Can't wait for it:)
@ferenc3460
@ferenc3460 3 жыл бұрын
Hey Dave! Another question, what if I get the $action variable with the $_REQUEST global instead of $_GET or $_POST globals?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
@@ferenc3460 that will work. $_REQUEST merges with other two with $_POST taking precendence over $_GET.
@srinivasaraoyp3640
@srinivasaraoyp3640 Жыл бұрын
That most interesting thing in this project is , you are showing what is a primary key? and what is a foreign key? And the working process of PHP code. This is wonderful Dave. Thank you very much.
@frvCars
@frvCars Жыл бұрын
There's not so many "Short" practical PHP projects on KZbin so I'm glad I've found your chanel a few days ago!😀
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Welcome aboard!
@willugoupordown
@willugoupordown 3 жыл бұрын
Thanks so much for sharing! VS Code tip: use shift+option+down arrow to copy/duplicate a full line or section of code.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Thanks! 🙏 It sounds like you are on a Mac. For Windows, I have been using Shift+Alt+Down Arrow lately. I appreciate the note! 💯
@abbasmohamedwalaal5753
@abbasmohamedwalaal5753 3 жыл бұрын
I am In Somalia (East Africa ) In here most web projects built in Php
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
It is a good choice! Thanks for watching 😀🙏
@wajidaanwarasha3092
@wajidaanwarasha3092 3 жыл бұрын
Hey I am new to using vs code and xampp. Can you tell me how you opened the html page on the web at 41:04?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
XAMPP runs a local development server that is available at the localhost address. After typing localhost in the address bar, follow it with a slash and the name of your project folder. That's what you see at the spot you indicated in your question. I have a XAMPP tutorial here: kzbin.info/www/bejne/mKXEpnR7psacnNk
@msecure7928
@msecure7928 2 жыл бұрын
sir, I'm waiting for your full laravel course. I really love your teaching way.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 🙏
@TenderHooligan
@TenderHooligan 10 ай бұрын
tell me this isn't begginer level though cus i didn't know what was going on half the time
@mayaratef5815
@mayaratef5815 11 ай бұрын
thanks for your efforts , I have a problem with CSS files that my php doesn't affect by the styling Iam sure with paths and every thing.
@hsardrake5373
@hsardrake5373 3 жыл бұрын
this video will make me great to continue practicing php, thanks!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Glad to hear that! 😀
@christiansimbarashe
@christiansimbarashe 3 жыл бұрын
Hi Dave, I'm a bit new to PHP and I am getting a fatal error round about minute 41 of the video where you display the view assignment list. I researched how to fix it for hours, gave up and downloaded the source code. Then when I run it I am getting the same error. How do I fix it? Thanks
@christiansimbarashe
@christiansimbarashe 3 жыл бұрын
The error is Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in C:\xampp\htdocs\assignmenttracker\model\assignments_db.php:12 Stack trace: #0 C:\xampp\htdocs\assignmenttracker\model\assignments_db.php(12): PDOStatement->execute() #1 C:\xampp\htdocs\assignmenttracker\index.php(30): get_assignments_by_course(NULL) #2 {main} thrown in C:\xampp\htdocs\assignmenttracker\model\assignments_db.php on line 12
@christiansimbarashe
@christiansimbarashe 3 жыл бұрын
At this point I am thinking that it is a problem with my database, but for the life of me I do not know where to begin fixing it
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Hi Christian. Yes, it looks like a database connection error. While I cannot troubleshoot problems for each viewer, I can make a suggestion. Please watch my tutorial on setting up XAMPP with MySQL to make sure your local database is setup correctly: kzbin.info/www/bejne/mKXEpnR7psacnNk And if everything is ok there, look for my SQL Crash Course video on my channel to walk-through connecting to the database and sending / retrieving data from it.
@christiansimbarashe
@christiansimbarashe 3 жыл бұрын
@@DaveGrayTeachesCode Alright then. Seems like I Have to go the long way that I wanted to avoid lol. Thanks Dave
@gamingnazul
@gamingnazul 3 жыл бұрын
@@christiansimbarashe hi, I found the exact same problem, did you found out the solution?
@shadesofgrey3367
@shadesofgrey3367 2 жыл бұрын
I'm learning loads from your videos, thanks. For this one, everything was going well until I added in the case code for the switch in index.php... Once that was typed in I have a couple of errors (which relate to text other than the case code) I realise you can't troubleshoot this, but am wondering if it's likely to be browser settings (although it's the same fofr Firefox and Chrome), or maybe VS Studio settings? I was also getting a couple of warnings because of the folders within folders, which you weren't getting in the video - why would this be? Or, is it because I'm on OSX (Macbook Pro 2015/Monterey)? Apart from that.......... I'm enjoying it immensely :) Warning: Use of undefined constant action - assumed 'action' (this will throw an Error in a future version of PHP) in /Applications/XAMPP/xamppfiles/htdocs/testing-folder/MVC-Tracker/index.php on line 19 Fatal error: Uncaught Error: Call to undefined function execute() in /Applications/XAMPP/xamppfiles/htdocs/testing-folder/MVC-Tracker/model/course_db.php:7 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/testing-folder/MVC-Tracker/index.php(71): get_courses() #1 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/testing-folder/MVC-Tracker/model/course_db.php on line 7
@hedaralmahdi2485
@hedaralmahdi2485 7 ай бұрын
شكرا لك على هذا المشروع لكن أريد ربطه ب صفحة تسجيل دخول كيف يمكنني ذلك؟
@milicavasovic96
@milicavasovic96 3 жыл бұрын
Hi, does anyone know answer to error SQLSTATE[HY000] [1049] Unknown database because before this project I have used database world and it only want to connect to that database and others do not recognize. How to fix this?
@DucMinhTeaching
@DucMinhTeaching 3 жыл бұрын
Hi, what is that "live sass compiler" for. I am using Sublime so I'm not sure if I have that! Thank you for this amazing video
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
It compiles the SCSS files to CSS. If remember correctly, I show the settings for how I have it compile my css to a minified file. I used to use Sublime 😀. Live Sass Compiler is a VS Code extension. You can use Sass at the command line without an IDE extension, too. Details here: sass-lang.com/install
@DucMinhTeaching
@DucMinhTeaching 3 жыл бұрын
@@DaveGrayTeachesCode Thank you for your prompt reply. I wonder if I have to configure anything on a remote server to have SASS running?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
No, it runs in your development environment and works directly with your files. 😀 It watches for any changes in your SCSS files and compiles a new CSS file when there are changes.
@salmamehanny4030
@salmamehanny4030 3 жыл бұрын
what is the best template engine can i use in native project with php?!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Good question! I haven't spent enough time with extras outside of native PHP to give a solid recommendation. PHP itself was designed as a template language allowing us to mix it with HTML. Let me know what you decide to use. 😃
@jeanlos3
@jeanlos3 3 жыл бұрын
Great tutorial.. but i have a question.. can i start learn laravel with this tutorial as a PHP base?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Thanks for asking - you can learn Laravel with a foundation of PHP knowledge. This tutorial provides some of that foundation, but I recommend viewing my full PHP playlist to get an overview: kzbin.info/aero/PL0Zuz27SZ-6MeRUt-z60DRxNqcrFAUYIb I'll be adding more to this list in the future, too. 🚀
@jeanlos3
@jeanlos3 3 жыл бұрын
@@DaveGrayTeachesCode thanks.. i Will watch this playlist and then begin with laravel.
@KeffelewAssefa
@KeffelewAssefa Жыл бұрын
Great tutorial, thank you
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@rimantasdanilevicius6754
@rimantasdanilevicius6754 2 жыл бұрын
Is this MVC project reliable and can be used in production?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
It is a simple project. It can be published and used. There are many enhancements that could be added yet including multi-user, but it does work as is.
@behroozyazdani6023
@behroozyazdani6023 2 жыл бұрын
Hi, Good Job, exclelent, thank bro
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome!
@francisseneve2934
@francisseneve2934 3 жыл бұрын
Symfony 5 course please you are a great teacher!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Thank you for the kind words and for the future tutorial suggestion. 🙏
@jayshyampatel
@jayshyampatel 2 жыл бұрын
Cannot find solution to this PDOException: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens in C:\xampp\htdocs\daveGray\mvc_assignment_tracker-main\mvc_assignment_tracker-main\model\assignment_db.php:12 Stack trace: #0 C:\xampp\htdocs\daveGray\mvc_assignment_tracker-main\mvc_assignment_tracker-main\model\assignment_db.php(12): PDOStatement->execute() #1 C:\xampp\htdocs\daveGray\mvc_assignment_tracker-main\mvc_assignment_tracker-main\index.php(67): get_assignments_by_course(NULL) #2 {main} thrown in C:\xampp\htdocs\daveGray\mvc_assignment_tracker-main\mvc_assignment_tracker-main\model\assignment_db.php on line 12
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
While I cannot troubleshoot each viewer's code, quickly looking at your error says it is on line 67 of index.php: "get_assignments_by_course(NULL)" ...this shows you are not passing a parameter value into the function. "Invalid parameter number" is accurate as you are missing a parameter.
@jayshyampatel
@jayshyampatel 2 жыл бұрын
@@DaveGrayTeachesCode thank you sir
@Jackbenjameson
@Jackbenjameson 2 жыл бұрын
@@DaveGrayTeachesCode I have that same issue when im just trying to load the source code you provided
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
@@Jackbenjameson if you work through the tutorial, you will see the code I have shared working. I cannot make accurate guesses at what you may have differently in the code or on your computer. You do also need the database that is created and to connect to it properly. If my memory is correct, all is shown in the tutorial video.
@Jackbenjameson
@Jackbenjameson 2 жыл бұрын
@@DaveGrayTeachesCode I had the issue when I was following the tutorial so that's why I decided to get the source code to see what I did wrong. It seems it has something to do with getting the assignment list when the Id is null.
@timliu1916
@timliu1916 3 жыл бұрын
Brilliant. Thank you!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
You're welcome! 🙏
@atouchofa.d.d.5852
@atouchofa.d.d.5852 3 жыл бұрын
I like your vids and always follow along. It's very challenging to follow along with code for some time without checking to see if your, (my), syntax is clean. I know it's hard to produce tight, time sensitive content. In this one there are many files opened and dependencies opened before anything get vetted.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Good feedback - thanks!
@imdtap1448
@imdtap1448 Жыл бұрын
Is this tutorial still useful to learn today? With the changes to PHP being V8.2?
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You can still learn a lot here. Any changes you note from v8.2 can be adjusted.
@imdtap1448
@imdtap1448 Жыл бұрын
@@DaveGrayTeachesCode Thanks Dave.
@iliasbekkali8652
@iliasbekkali8652 3 жыл бұрын
a huge thank you from Morocco , that tutorial was awesome and helpful , is there a way to get the source code ??
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
I need to put a link to it in the description. Thanks for the reminder! 😀
@iliasbekkali8652
@iliasbekkali8652 3 жыл бұрын
​@@DaveGrayTeachesCode your welcome, it's fine i wrote the project entirely , that made me more interactive with faults and taught me how to correct them. i liked how the project is very clear and easy to undesrtand , comparing to some other who are not ordered , however , in some other youtubers projects , they re adding an other file called "controller" , i think they make their project more complex, wich i didn't really like . and thank you very much for this awesome mvc model project
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
@@iliasbekkali8652 You're welcome, and yes, I'm sure there are more complex tutorials available. This is for beginners and I'm glad it helped you.
@milicavasovic96
@milicavasovic96 3 жыл бұрын
Is this OOP?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
No, it is a functional approach. I am working on a PHP OOP series that I hope to release in the next couple of months.
@devwithbrian1534
@devwithbrian1534 10 ай бұрын
Thanks Dave
@sunyu695
@sunyu695 2 жыл бұрын
非常棒的教程,谢谢。
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome! 💯
@afrozascreativeidea4139
@afrozascreativeidea4139 2 жыл бұрын
Is it a web application?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
It works in desktop and mobile. Yes, it is a web app created with PHP.
@afrozascreativeidea4139
@afrozascreativeidea4139 2 жыл бұрын
Can you make a big web application project like these video.??
@vilmosszabo6782
@vilmosszabo6782 3 жыл бұрын
Can you upload the source code?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
I may need to add the link to the GitHub repository. At first I thought it was there. 👍
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 жыл бұрын
Update: I've got a link in the description for it now.
@behroozyazdani6023
@behroozyazdani6023 2 жыл бұрын
Personal Bookmark: PHP MVC
@fredoscott2346
@fredoscott2346 Жыл бұрын
This is lightyears away from MVC standards. It's not even OOP! Most of it is plain, procedural PHP.
Deploy with Docker - Step-by-step Tutorial
20:20
Dave Gray
Рет қаралды 26 М.
Create a Custom PHP MVC Framework in Just 1 Hour | Intermediate
45:55
Coding with Pixel Fix
Рет қаралды 2,3 М.
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
Learn PHP MVC  Framework  in Hindi part 1
19:31
Programming with Vishal
Рет қаралды 66 М.
1. Build a CMS using OOP PHP tutorial | PHP MVC design pattern
20:26
Applicable Programming
Рет қаралды 64 М.
PHP Flash Cards Practice Project | PHP Tutorial for Beginners
1:04:04
I built an app using a single index.php file, here's how it went
32:42
Andrew Schmelyun
Рет қаралды 91 М.
PHP OOP -  Beginners Crash Course
24:05
Traversy Media
Рет қаралды 160 М.
PHP Framework Pro (Create a PHP framework step by step)
1:12:14
Gary Clarke
Рет қаралды 30 М.
Learn Object Oriented PHP - 3 Hour PHP OOP Course
3:00:42
Gary Clarke
Рет қаралды 65 М.