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
@ferenc34603 жыл бұрын
Hey Dave! Great tutorial! Is it possible to some familiar project but with sessions and file upload in MVC? Thank you in advance :)
@DaveGrayTeachesCode3 жыл бұрын
@@ferenc3460 yes it is. 😃 Thanks for the request! 💯
@ferenc34603 жыл бұрын
@@DaveGrayTeachesCode wow, such a fast response! Can't wait for it:)
@ferenc34603 жыл бұрын
Hey Dave! Another question, what if I get the $action variable with the $_REQUEST global instead of $_GET or $_POST globals?
@DaveGrayTeachesCode3 жыл бұрын
@@ferenc3460 that will work. $_REQUEST merges with other two with $_POST taking precendence over $_GET.
@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 Жыл бұрын
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 Жыл бұрын
Welcome aboard!
@willugoupordown3 жыл бұрын
Thanks so much for sharing! VS Code tip: use shift+option+down arrow to copy/duplicate a full line or section of code.
@DaveGrayTeachesCode3 жыл бұрын
Thanks! 🙏 It sounds like you are on a Mac. For Windows, I have been using Shift+Alt+Down Arrow lately. I appreciate the note! 💯
@abbasmohamedwalaal57533 жыл бұрын
I am In Somalia (East Africa ) In here most web projects built in Php
@DaveGrayTeachesCode3 жыл бұрын
It is a good choice! Thanks for watching 😀🙏
@wajidaanwarasha30923 жыл бұрын
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?
@DaveGrayTeachesCode3 жыл бұрын
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
@msecure79282 жыл бұрын
sir, I'm waiting for your full laravel course. I really love your teaching way.
@DaveGrayTeachesCode2 жыл бұрын
Thank you! 🙏
@TenderHooligan10 ай бұрын
tell me this isn't begginer level though cus i didn't know what was going on half the time
@mayaratef581511 ай бұрын
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.
@hsardrake53733 жыл бұрын
this video will make me great to continue practicing php, thanks!
@DaveGrayTeachesCode3 жыл бұрын
Glad to hear that! 😀
@christiansimbarashe3 жыл бұрын
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
@christiansimbarashe3 жыл бұрын
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
@christiansimbarashe3 жыл бұрын
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
@DaveGrayTeachesCode3 жыл бұрын
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.
@christiansimbarashe3 жыл бұрын
@@DaveGrayTeachesCode Alright then. Seems like I Have to go the long way that I wanted to avoid lol. Thanks Dave
@gamingnazul3 жыл бұрын
@@christiansimbarashe hi, I found the exact same problem, did you found out the solution?
@shadesofgrey33672 жыл бұрын
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
@hedaralmahdi24857 ай бұрын
شكرا لك على هذا المشروع لكن أريد ربطه ب صفحة تسجيل دخول كيف يمكنني ذلك؟
@milicavasovic963 жыл бұрын
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?
@DucMinhTeaching3 жыл бұрын
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
@DaveGrayTeachesCode3 жыл бұрын
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
@DucMinhTeaching3 жыл бұрын
@@DaveGrayTeachesCode Thank you for your prompt reply. I wonder if I have to configure anything on a remote server to have SASS running?
@DaveGrayTeachesCode3 жыл бұрын
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.
@salmamehanny40303 жыл бұрын
what is the best template engine can i use in native project with php?!
@DaveGrayTeachesCode3 жыл бұрын
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. 😃
@jeanlos33 жыл бұрын
Great tutorial.. but i have a question.. can i start learn laravel with this tutorial as a PHP base?
@DaveGrayTeachesCode3 жыл бұрын
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. 🚀
@jeanlos33 жыл бұрын
@@DaveGrayTeachesCode thanks.. i Will watch this playlist and then begin with laravel.
@KeffelewAssefa Жыл бұрын
Great tutorial, thank you
@DaveGrayTeachesCode Жыл бұрын
Glad it was helpful!
@rimantasdanilevicius67542 жыл бұрын
Is this MVC project reliable and can be used in production?
@DaveGrayTeachesCode2 жыл бұрын
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.
@behroozyazdani60232 жыл бұрын
Hi, Good Job, exclelent, thank bro
@DaveGrayTeachesCode2 жыл бұрын
You're welcome!
@francisseneve29343 жыл бұрын
Symfony 5 course please you are a great teacher!
@DaveGrayTeachesCode3 жыл бұрын
Thank you for the kind words and for the future tutorial suggestion. 🙏
@jayshyampatel2 жыл бұрын
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
@DaveGrayTeachesCode2 жыл бұрын
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.
@jayshyampatel2 жыл бұрын
@@DaveGrayTeachesCode thank you sir
@Jackbenjameson2 жыл бұрын
@@DaveGrayTeachesCode I have that same issue when im just trying to load the source code you provided
@DaveGrayTeachesCode2 жыл бұрын
@@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.
@Jackbenjameson2 жыл бұрын
@@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.
@timliu19163 жыл бұрын
Brilliant. Thank you!
@DaveGrayTeachesCode3 жыл бұрын
You're welcome! 🙏
@atouchofa.d.d.58523 жыл бұрын
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.
@DaveGrayTeachesCode3 жыл бұрын
Good feedback - thanks!
@imdtap1448 Жыл бұрын
Is this tutorial still useful to learn today? With the changes to PHP being V8.2?
@DaveGrayTeachesCode Жыл бұрын
You can still learn a lot here. Any changes you note from v8.2 can be adjusted.
@imdtap1448 Жыл бұрын
@@DaveGrayTeachesCode Thanks Dave.
@iliasbekkali86523 жыл бұрын
a huge thank you from Morocco , that tutorial was awesome and helpful , is there a way to get the source code ??
@DaveGrayTeachesCode3 жыл бұрын
I need to put a link to it in the description. Thanks for the reminder! 😀
@iliasbekkali86523 жыл бұрын
@@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
@DaveGrayTeachesCode3 жыл бұрын
@@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.
@milicavasovic963 жыл бұрын
Is this OOP?
@DaveGrayTeachesCode3 жыл бұрын
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.
@devwithbrian153410 ай бұрын
Thanks Dave
@sunyu6952 жыл бұрын
非常棒的教程,谢谢。
@DaveGrayTeachesCode2 жыл бұрын
You're welcome! 💯
@afrozascreativeidea41392 жыл бұрын
Is it a web application?
@DaveGrayTeachesCode2 жыл бұрын
It works in desktop and mobile. Yes, it is a web app created with PHP.
@afrozascreativeidea41392 жыл бұрын
Can you make a big web application project like these video.??
@vilmosszabo67823 жыл бұрын
Can you upload the source code?
@DaveGrayTeachesCode3 жыл бұрын
I may need to add the link to the GitHub repository. At first I thought it was there. 👍
@DaveGrayTeachesCode3 жыл бұрын
Update: I've got a link in the description for it now.
@behroozyazdani60232 жыл бұрын
Personal Bookmark: PHP MVC
@fredoscott2346 Жыл бұрын
This is lightyears away from MVC standards. It's not even OOP! Most of it is plain, procedural PHP.