r/PHP • u/KingBrooooom • May 18 '24
Discussion Learning PHP as a beginner
I have never programmed before. However, I have a very serious interest in learning PHP and SQL.
I am open to any suggestions on where to start and what to focus on. Courses, tutorials, websites, etc.
If you were starting fresh today, with no knowledge, where would you start? What sort of “roadmap” would you follow?
78
Upvotes
55
u/benanamen May 18 '24
This is a great series that will take you all the way from zero to expert.
GIO PHP
18
u/colshrapnel May 18 '24
Jon Duckett's PHP&MySQL book is written specifically for someone without any prior knowledge on PHP or programming in general. Very few authors realize that even most basic concepts need to be explained, and not taken for granted. What is a variable, what is a literal, what is a database, and so on. Jon is excellent in explaining these matters in simple terms and tons of examples.
Besides, as it was suggested in the other comment, learning is best when having a task. And Jon has one - creating a sort of social network/art blog with likes and comments, which is completed throughout the latter parts of the book.
6
u/pyeri May 18 '24
Modern PHP by Josh Lockhart is a great place to learn and start.
But post that, only your interest in web development and pragmatic keenness towards programming will determine how far you'll go.
3
u/Plus-You-3628 May 18 '24
i tried w3scholl and books, they were little boring for me, after I found PHP for Beginners by Laracast.
it is a series that teaches you php Mysql and etc. you will build a MVC design pattern by doing the trainings.
after that you can go to Laravel for beginners by Laracast. it's free on youtube.
4
u/VRT303 May 18 '24
https://trello.com/b/lE7Ks8dx/gabs-php-backend-focus-learning-suggestions
This was my journey.
2
u/Horstcredible May 18 '24
General advice for a roadmap: Roadmap.sh hat General roadmaps for different areas of IT.
If you want to learn PHP and SQL that sounds like backend engineering to me. There is a roadmap for this: https://roadmap.sh/backend
Every topic has linked information for further reading included.
Happy hacking!
2
u/New-Firefighter-7020 May 22 '24
I’m assuming you know HTML5 and CSS?
Although PHP can be used without them, I think learning those two before you get started with PHP and sql will serve you well.
After that, learn basic PHP like types, variables, if statements and loops.
Then learn how to store data in a database. Something like PHPMyAdmin is a great way to get started (if using windows, install XAMPP - gives you everything you need to get started as a PHP dev including Apache and MySQL).
Once you have data in your database, you can learn PHP and SQL pretty much together. All you need to do is assign your SQL statement to a variable and then let PHP take care of the rest by assigning data to associative arrays (should have been learned with basic PHP) and looping over those arrays to put data on the webpage.
From there, it’s all about practice.
I think you’ve chosen a great path! Good luck and don’t give up! You’re going to feel completely inadequate at times as you learn how to program, but that is completely NORMAL. I’ve been a developer for 3 years and feel stupid on a daily basis! Haha Haven’t gotten fired yet, so I must be doing something right! :)
4
u/Jean1985 May 18 '24
https://phptherightway.com/ is a suggestion that I always give to beginners. It's small but it has a lot of useful concepts and it leads you toward best practices and good standards.
4
u/TopBantsman May 18 '24
Lots of people will tell you all the fundamentals you must learn first and books you should read and roadmaps you should follow. I personally believe this sort of advice just leads to quick burn out and new learners becoming overwhelmed.
My advice would be to just follow a video course like https://laracasts.com/series/30-days-to-learn-laravel-11 and then once you're done translate it to a project of your own. This will ground your learning in something practical and you'll retain your motivation to learn. You can then go back and learn the fundamentals with a frame of reference, so they're A, more likely to sink in, and B, less likely to overwhelm you.
3
u/WakeUpMrOppositeEast May 18 '24 edited May 18 '24
Look into roadmap.sh, it contains roadmaps for a lot of developer jobs. It is less a tutorial or course but more an orientation or a map that you can follow. If you are interested in PHP and Databases I would recommend you to look into the backend developer roadmap.
You can find a lot of the topics mentioned on that roadmap on symfonycasts.com and laracasts.com
Those two are focused on the symfony and laravel frameworks but they also offer some more general purpose courses for php
EDIT: Just wanted to encourage you not to feel overwhelmed by the number of topics on that roadmap. They are definitely important but you will learn a lot of these while working on projects and you don’t necessarily have to master all of them. The first few are definitely important, but you don’t have to finish courses for all of the later topics to be a great or even good backend engineer. A lot of this will come naturally to you the further you immerse yourself in the backend world.
2
u/Noname_Maddox May 18 '24
Ive never been a book reader or tutorial watcher. I learn through problem solving.
So I need a problem to solve.
So when I started programming, I was always trying to fix something. The best thing I was ever taught was writing the steps of how to solve a problem in pseudocode and then put each step as a comment in my code and just solve each step.
Can be as simple as display time.
Or 4 or 5 steps to take inputs and solve a math problem.
You should know what each step is. You just have to look on docs, W3schools samples to get code so you understand what each part does.
Do this for a day or two and maybe then jump into tutorials or whatever.
Tutorials can be like getting blasted with information especially if you’ve never done programming.
You need to get a feel for the code on your own first.
3
u/inkt-code May 19 '24
I went to school to learn it, I’m not saying it can’t be self taught, but how it’s learned is definitely important to employers. I know I wouldn’t have the job I have today without a formal education.
That said, I learn daily, most of it from stack overflow, or the online docs for whatever language.
6
u/rkeet May 18 '24
Symfony.com/book for a hands-on walk through from basics to advanced. Does rely on the framework, but that makes it practical focused.
Refactoring.guru for patterns with examples and exercises (in many languages).
1
u/mrmorris96 May 18 '24
Laracasts PHP for beginners
0
u/fish3010 May 18 '24
Laracasts
0
u/[deleted] May 18 '24
[deleted] — view deleted comment
8
u/[deleted] May 18 '24 edited Jun 05 '26 •
[removed] — view removed comment
0
u/[deleted] May 18 '24
[removed] — view removed comment