Skip to content
Sabaqاردو

PHP and MySQL Tutorial for Beginners (Net Ninja)

By Net Ninja

Course audio
Course audio: English
Level
Beginner
Length
42 lessons · 6.1 hours

What you'll be able to do

  • Write PHP scripts with variables, arrays, loops and functions
  • Process and validate HTML form input safely
  • Read, save and delete records in MySQL from PHP
  • Use sessions, cookies and basic classes

About this course

Net Ninja teaches PHP from zero in 42 English-language lessons, about 6.1 hours. After installing XAMPP and writing a first file, it covers variables, strings, numbers, arrays, loops, conditionals, functions, scope and include and require. A small pizza-style project then adds forms, XSS protection and validation. The middle section introduces MySQL: creating a database, connecting, reading, saving and deleting records and showing them in the browser. The final lessons add sessions, cookies, superglobals, the file system and classes and objects. It suits beginners who know basic HTML and want to understand server-side code before moving to a framework such as Laravel.

Before you start: Basic HTML; Basic computer use

Syllabus

42 lessons · 6:07:43 in total

  1. 1PHP Tutorial (& MySQL) #1 - Why Learn PHP?7:05
  2. 2PHP Tutorial (& MySQL) #2 - Installing PHP (XAMPP)9:29
  3. 3PHP Tutorial (& MySQL) #3 - Your First PHP File7:54
  4. 4PHP Tutorial (& MySQL) #4 - Variables & Constants7:18
  5. 5PHP Tutorial (& MySQL) #5 - Strings11:57
  6. 6PHP Tutorial (& MySQL) #6 - Numbers9:55
  7. 7PHP Tutorial (& MySQL) #7 - Arrays16:57
  8. 8PHP Tutorial (& MySQL) #8 - Multidimensional Arrays10:07
  9. 9PHP Tutorial (& MySQL) #9 - Loops19:35
  10. 10PHP Tutorial (& MySQL) #10 - Booleans & Comparisons12:08
  11. 11PHP Tutorial (& MySQL) #11 - Conditional Statements12:10
  12. 12PHP Tutorial (& MySQL) #12 - Continue & Break3:56
  13. 13PHP Tutorial (& MySQL) #13 - Functions12:30
  14. 14PHP Tutorial (& MySQL) #14 - Variable Scope8:58
  15. 15PHP Tutorial (& MySQL) #15 - Include & Require5:27
  16. 16PHP Tutorial (& MySQL) #16 - Project Header & Footer11:01
  17. 17PHP Tutorial (& MySQL) #17 - Forms in PHP16:09
  18. 18PHP Tutorial (& MySQL) #18 - XSS Attacks4:15
  19. 19PHP Tutorial (& MySQL) #19 - Basic Form Validation (part 1)5:59
  20. 20PHP Tutorial (& MySQL) #20 - Filters & More Validation13:05
  21. 21PHP Tutorial (& MySQL) #21 - Showing Errors10:45
  22. 22PHP Tutorial (& MySQL) #22 - Checking for Errors & Redirecting5:01
  23. 23PHP Tutorial (& MySQL) #23 - MySQL Introduction5:25
  24. 24PHP Tutorial (& MySQL) #24 - Setting Up a MySQL Database7:54
  25. 25PHP Tutorial (& MySQL) #25 - Connecting to a Database5:54
  26. 26PHP Tutorial (& MySQL) #26 - Getting Data From a Database7:16
  27. 27PHP Tutorial (& MySQL) #27 - Rendering Data to the Browser8:18
  28. 28PHP Tutorial (& MySQL) #28 - The Explode Function6:25
  29. 29PHP Tutorial (& MySQL) #29 - Control Flow Alt Syntax4:00
  30. 30PHP Tutorial (& MySQL) #30 - Saving Data to the Database10:44
Show all 42 lessons
  1. 31PHP Tutorial (& MySQL) #31 - Getting a Single Record13:08
  2. 32PHP Tutorial (& MySQL) #32 - Deleting a Record9:29
  3. 33PHP Tutorial (& MySQL) #33 - Finishing Touches3:46
  4. 34PHP Tutorial (& MySQL) #34 - Ternary Operators5:10
  5. 35PHP Tutorial (& MySQL) #35 - Superglobals5:08
  6. 36PHP Tutorial (& MySQL) #36 - Sessions9:05
  7. 37PHP Tutorial (& MySQL) #37 - Null Coalescing3:09
  8. 38PHP Tutorial (& MySQL) #38 - Cookies5:51
  9. 39PHP Tutorial (& MySQL) #39 - File System (part 1)6:36
  10. 40PHP Tutorial (& MySQL) #40 - File System (part 2)8:24
  11. 41PHP Tutorial (& MySQL) #41 - Classes & Objects (part 1)11:29
  12. 42PHP Tutorial (& MySQL) #42 - Classes & Objects (part 2)8:51

Questions

How long is this course?
It has 42 lessons and about 6.1 hours of video (6:07:43 in total). Your progress is saved lesson by lesson, so you can stop and continue on any device you sign in on, or in the same browser without signing in.
Is this course in English?
The lessons are taught in English. The teacher is Net Ninja; the videos play from their official YouTube channel, and Sabaq adds the lesson order, progress tracking, notes and the summary on this page.
Who is this course for, and what should I know first?
It is aimed at beginners: it starts from the basics. Before you start: Basic HTML; Basic computer use.
Is it free, and do I need an account?
Yes, it is free to watch and no account is needed. The videos are official uploads by the teacher on YouTube; a free DanixSoft account is optional and only syncs your progress between devices.
What should I take after this course?
A good next step on Sabaq is “CS50's Introduction to Databases with SQL (Harvard)”. The “What to take next” list on this page shows more courses at the same or a higher level in the same topic.

What to take next

Videos by Net Ninja, played from their official YouTube channel. Subscribe on YouTube

Official upload by the teacher or institution on their own channel, shown with YouTube's embedded player.

Lessons listed from the official YouTube playlist. Full playlist on YouTube

Lessons last checked Nov 2026. Course summary and lesson structure by Sabaq.

Report a problem or a rights request