Pelajaran 5 - Belajar Kombinasi Php dan Database Mysql (Mariadb) untuk Web Apps Anda
Linkman Pwa - Sun 30/May/2021 7:39pm [Last Comment]
Selepas meneliti banyak video tutorial, saya rasa video dari The Net Ninja mungkin yg terbaik sekali.

The Net Ninja
Playlist Php & Mysql for beginner
https://www.youtube.com/playlist?list=PL4cUxeGkcC9gksOX3Kd9KPo-O68ncT05o

Di youtube ada banyak tutorial php dan mysql. Tapi nak cari yg kualiti tinggi kena ambik masa juga.

- Ada yg terlalu panjang, tutorial dibuat secara sekaligus sampai 4 jam
- Ada yg terlalu meleret2 macam mengajar budak darjah 1
- Ada yg mengasingkan php dan mysql kedalam 2 siri berlainan

Bagi saya cara terbaik utk belajar php dan mysql adalah:

1) Syllabus yg jelas.

Syllabus diasingkan menjadi pecahan kecik2. Instead of masukkan semua tutorial kedalam 1 video.. sepatutnya video dipecahkan kepada tutorial pendek2 dlm 5-15 minutes each.

2) Speed yg sesuai.

Kelajuan hendaklah mengandaikan pelajar tu manusia dengan kelayakan normal samada lepasan degree, diploma atau mana2 sijil kemahiran. Kalau tak ada semua pun tak apa janji ada kemahuan yg tinggi utk belajar. Jangan ajar seperti budak darjah 1.. terlalu slow dan meleret2.

3) Versi yg terbaru.

Sebaik2nya tutorial yg dibuat dalam masa beberapa tahun kebelakang sahaja.. 2018 - 2021. Jangan belajar dari tutorial yg dah terlalu lama contohnya 2015 atau sebelumnya sebab dah ada banyak cerita2 baru sejak tarikh tersebut.

4) Satukan php dan mysql

Saya berpendapat gabungan php dan database mysql (mariadb) yg diajar serentak lebih baik dari syllabus yg diasingkan sebab kedua2 teknologi ini saling memerlukan diantara satu sama lain.. ibarat aur dengan tebing thehe..

5) Pilihan samada OOP atau PP

Pilihan samada belajar secara OOP (Object Oriented Programming) atau (PP) Procedural Programming. Bagi saya cara paling mudah adalah belajar Procedural Programming.

Kalau ada expert computer software engineer yg suruh belajar OOP sebab lagi advance.. bagi saya utk membina website apps utk keperluan produk kita sendiri tak perlu OOP. Memadailah utk belajar Procedural sahaja.

Saya ibaratkan belajar OOP utk buat apps sendiri umpama membawa pickup hilux 4x4 turbo diesel 2.4 liter, dengan tayar sport rim 20 inci.. hanya utk beli beras dan groceries mingguan di tesco atau kedai runcit mamak tepi corner sahaja.. tak ada faedahnya..

Pilihan Utama
============

Selepas meneliti berpuluh2 video yoube.. saya rasa video dari The Net Ninja mungkin yg terbaik sekali buat masa ini (May 2021).

The Net Ninja
Playlist Php & Mysql for beginner
https://www.youtube.com/playlist?list=PL4cUxeGkcC9gksOX3Kd9KPo-O68ncT05o

- Ada 42 tutorial semuanya
- Kesemuanya pendek2 dari 5 hingga 15 minit setiap satu.
- Kesemuanya dibuat sekitar awal 2019, bermakna tutorial ini sesuai utk php7.x
- Jika anda bermula hari ini.. InsyaAllah boleh tamat dalam masa 1 bulan sahaja.

Di comment dibawah, saya akan buat review (nota ringkas) bagi setiap satu tutorial. Gunanya adalah utk refresh my knowledge sebab last sekali saya try programming dlm 2015.. dah lama sangat tu...

Selamat Mencuba!!

Niche: Diskusi Bisnes | Web Design Malaysia | Perisian Komputer
 
1. Syedmba - Mon 31/May/2021, 3:04pm
Terima Kasih  
2. Linkman - Mon 31/May/2021, 8:24pm
Selamat Mencuba Tuan Syedmba!

Owner The Net Ninja menggunakan English slang Yorkshire, England. Jika bunyinya pelik sikit.. memang mcm tu lah gayanya..

Tut 1 - Why Learn PHP?
https://youtu.be/pWG7ajC_OVo
- 7 minutes
- Sebab php masih sangat popular. Hampir semua content management software yg utama menggunakan php. (wordpress, drupal, magento dll)
- programming language yg mudah dipelajari
- sangat banyak job requirement yg memerlukan php.  
3. Linkman Pwa - Mon 31/May/2021, 8:34pm
Tut 2 - Installing PHP & Mysql locally using XAMPP
https://youtu.be/3B-CnezwEeo

Php dan mysql sepatutnya run di server. Kita perlu beli web hosting package. Tetapi utk tujuan development, kita boleh install kesemua komponen di laptop kita sendiri (windows/mac/linux). Tak perlu beli webhosting. Perisian yg digunakan adalah XAMPP.

Download here:
https://www.apachefriends.org

XAMPP = X + Apache + MariaDb + Php atau Perl
X adalah Windows atau Apple Mac atau Linux

MariaDb adalah hampir 99.99% sama dgn Mysql. Selepas Oracle membeli Sun Microsystem pada 2009 dan memiliki trademark database Mysql, ramai developer tidak berpuas hati lalu membuat 'fork' iaitu cabang baru yg 100% serupa pada tahun yg sama dan dinamakan MariaDb.  
4. Linkman Pwa - Mon 31/May/2021, 8:57pm
Tut 3 - Your First PHP File
https://youtu.be/ABcXbZLm5G8

- php tags & php files
- using echo
- embedding php inside HTML files  
5. Linkman Pwa - Mon 31/May/2021, 9:11pm
Tut 4 - Variables & Constants
https://youtu.be/2CXme275t9k

- php variables using $ (dollar) sign
- using camelCaseVariableNaming
- constant using define()  
6. Linkman Pwa - Mon 31/May/2021, 9:26pm
Tut 5 - Strings
https://youtu.be/U2EliFC9NrQ

- what is strings
- concatenant (joining 2 strings) using dot
- using single quote or double quote
- escaping characters using back-slash.
- square bracket notation
- strlen() - finding string length
- strtoupper - convert string to upper case
- strtolower - convert string to lower case
- str_replace() - replace character with another character in a string  
7. Linkman Pwa - Mon 31/May/2021, 9:47pm
Tut 6 - Numbers
https://youtu.be/lT2AvQ17F_w

- integers - whole numbers
- float or double - can contain desimals
- basic operators - multiply, divide, add, substract, power of
- order of operation (B I D M A S)
- Bracket, Indices, Division, Multiplication, Addition, Substraction
- shorthand operators
- floor() function
- ceil() function (ceiling)
- pi() function  
8. Linkman Pwa - Tue 1/Jun/2021, 4:17pm
Tut 7 - Arrays
https://youtu.be/bWygRxrlD44

- What is array?
- A way to store multiple different values in a single variables
- There are 3 types of arrays
1) Indexed arrays - refer by index number
2) Associative arrays - refer by names (value pairs)
3) Multidimensional arrays - next Tutorial

- can use technique square bracket or array()
- use print_r because echo doesnt work
- how to override values in array
- how to add new values in array (2 ways)
- count() to count the numbers of elements in array
- merge 2 arrays using array_merge()  
9. Linkman Pwa - Tue 1/Jun/2021, 4:41pm
Tut 8 - Multidimensional Arrays
https://youtu.be/G1iDSoAXyvM

- multidimensional array is arrays inside array
- can store more information
- using print_r() selectively
- array_pop() - remove the last array  
10. Linkman Pwa - Tue 1/Jun/2021, 5:05pm
Tut 9 - Loops
https://youtu.be/TBUgZ84tTgU

1) for loop
for ($i=0; $i < 5; $i++) { /* codes here */ }

2) foreach loop - usually for printing arrays
foreach ($a as $b) { /* codes here */ }

3) while loop
- very similar to for loop but $i & $i++ in different places.  
11. Linkman Pwa - Tue 1/Jun/2021, 5:30pm
Tut 10 - Booleans (true or false) & Comparisons
https://youtu.be/hxYQA-nuIXY

- true is 1
- false is 0 or nothing (empty string)
- comparing numbers
- comparing strings (true/false based on the orders of the first alphabet)
- loose comparison (==) and strict comparison (===) for specific datatypes  
12. Linkman Pwa - Tue 1/Jun/2021, 8:07pm
Tut 11 - Conditional Statements
https://youtu.be/E1ms4qpfy78

- if, elseif & else statement
- double ampersands (&&) is AND
- double pipes (||) is OR  
13. Linkman Pwa - Tue 1/Jun/2021, 8:15pm
Tut 12 - Break & Continue
https://youtu.be/sEq6riJ0Do8

- break statement will stop a loop if condition is met
- continue statement will bypass subsequent codes and continue looping next  
14. Linkman Pwa - Tue 1/Jun/2021, 8:40pm
Tut 13 - Functions
https://youtu.be/438PsnpJj5E

- create our own function()
- passing values in function
- setting default values in function  
15. Linkman Pwa - Tue 1/Jun/2021, 8:51pm
Tut 14 - Variable Scope
https://youtu.be/YCw3z-yEiwQ

- local scope inside function()
- global scope inside & outside function()
- passing variable by reference (&) same effect as global  
16. Linkman Pwa - Tue 1/Jun/2021, 8:58pm
Tut 15 - Include & Require
https://youtu.be/Tf6erFtmN-Q

- include() file still work if file does not exist
- require() file will stop working (fatal error) if file does not exist
- include_once() and require_once() will just fetch it once  
17. Linkman Pwa - Tue 1/Jun/2021, 9:11pm
Tut 16 - Project Header & Footer
https://youtu.be/-KUFcX7WLaA

- now we will start building real php web page
- we will use Materialize CSS framework
- we will create header and footer that will be used in all our webpages  
18. Linkman Pwa - Tue 1/Jun/2021, 9:35pm
Tut 17 - Forms in PHP
https://youtu.be/Ucq4BA-gMO0

- there are 2 methods, GET & POST
- GET send the data in URL (very visible)
- POST send data in the request header (hidden)
- we will create form to add pizza
- then pass the data using GET and POST to the same add.php file
- use isset() function to check data exist when submit form
- the POST method is better because data is hidden  
19. Linkman Pwa - Tue 1/Jun/2021, 9:44pm
Tut 18 - Forms: Preventing XSS Attacks
https://youtu.be/EhOcAZJp81s

- how to prevent cross site scripting attack (XSS attack)
- use htmlspecialchars() function to prevent XSS attack

Php Manual: htmlspecialchars()
https://www.php.net/manual/en/function.htmlspecialchars.php  
20. Linkman Pwa - Wed 2/Jun/2021, 11:08am
Tut 19 - Forms: Basic Validation
https://youtu.be/g7x4JO0YW1s

- server side validation using php
- check to make sure user enter the correct info  
21. Linkman Pwa - Wed 2/Jun/2021, 11:33am
Tut 20 - Forms: Filters & More Validation
https://youtu.be/wFiCZHrCFOw

- using regular expression (REGEX)
- for email, we use php built-in filter FILTER_VALIDATE_EMAIL
- learn negation (!) technique in php
- for text field, we use REGEX

For regex tutorial, klick here:
https://www.youtube.com/playlist?list=PL4cUxeGkcC9g6m_6Sld9Q4jzqdqHd2HiD  
22. Linkman Pwa - Wed 2/Jun/2021, 12:11pm
Tut 21 - Forms: Showing Input Errors
https://youtu.be/firSTs1bEEY

- put error messages in an array
- use associative array
- dsplay error near the relevant fields  
23. Linkman Pwa - Wed 2/Jun/2021, 4:55pm
Tut 22 - Forms: Checking for Errors & Redirecting
https://youtu.be/GS2sUveQpU4

- if the form has error, dont go anywhere
- if no error, go to next page
- check error with array_filter()
- use header('Location: ') function to redirect to other page  
24. Linkman Pwa - Wed 2/Jun/2021, 5:06pm
Tut 23 - MySQL Introduction
https://youtu.be/N2L9KZo2szY

- start to learn Mysql database
- what is relational database  
25. Linkman Pwa - Wed 2/Jun/2021, 5:23pm
Tut 24 - Setting Up a MySQL Database
https://youtu.be/YFlIw4KMpVM

- using PhpMyAdmin software
- create table and number of columns
- for ID, use INT with AutoIncrement & Primary Key feature
- for title, use varchar with 255 length
- for date/time, use TIMESTAMP with CURRENT_TIME  
26. Linkman Pwa - Wed 2/Jun/2021, 5:34pm
Tut 25 - Connecting to a Database
https://youtu.be/zpTlJ6dtOxA

- add user account in mysql using phpmyadmin
- then connect to mysql using php mysqli_connect()
- if error, show using mysqli_connect_error()  
27. Linkman Pwa - Wed 2/Jun/2021, 6:22pm
Tut 26 - Getting Data From a mysql Database
https://youtu.be/WGuyxGJW9hs

- our first mysql query using mysqli_query()
- then fetch resulting rows as an array using:
mysqli_fetch_all($result, MYSQLI_ASSOC)
- then free the memory using mysqli_free_result()
- then close connection using mysqli_close()
- then see result using $print_r  
28. Linkman Pwa - Wed 2/Jun/2021, 6:34pm
Tut 27 - Rendering Data to the Browser
https://youtu.be/3T8bp9DlypU

- rendering data using foreach loop
- use materialize CSS to format output  
29. Linkman Pwa - Wed 2/Jun/2021, 6:46pm
Tut 28 - Rendering Data: the Explode Function
https://youtu.be/wT5CVoOdLlE

- using explode() function
- then use foreach loop  
30. Linkman Pwa - Wed 2/Jun/2021, 7:01pm
Tut 29 - Control Flow Alternative Syntax
https://youtu.be/1Py5GjnnreE

- this tutorial is a sidenote
- for better code readibility, we will use this syntax
- foreach with endforeach
- if with endif  
31. Linkman Pwa - Thu 3/Jun/2021, 3:28pm
Tut 30 - Saving Data to the Database
https://youtu.be/ijHc_3t2arE

- first, modularised the database connection
- sanitise data before adding to mysql with mysql_real_escape_string()
- add data using INSERT INTO statement  
32. Linkman Pwa - Thu 3/Jun/2021, 3:52pm
Tut 31 - Getting a Single Record
https://youtu.be/G8OYy-y3C9A

- how to view details of a single record
- send the record ID using GET request
- use sql statement - SELECT FROM WHERE
- use php statement - mysql_fetch_assoc($result)
- the fren reesult with - mysql_free_result($result)
- then close connection with - mysql_close($conn)  
33. Linkman Pwa - Thu 3/Jun/2021, 4:10pm
Tut 32 - Deleting a Record
https://youtu.be/3lpPfEdU-8A

- using hidden input type to pass ID
- use sql statement - de1ete FROM  
34. Linkman Pwa - Thu 3/Jun/2021, 4:37pm
Tut 33 - Finishing Touches
https://youtu.be/vkH5WZ-4ngU

- using CSS tu beautify the website
- our small pizza project completed!  
35. Linkman Pwa - Thu 3/Jun/2021, 4:49pm
Tut 34 - Ternary Operators
https://youtu.be/L-S0rsFR-gQ

- ternary operators are ways to write code that is shorter and cleaner  
36. Linkman Pwa - Thu 3/Jun/2021, 4:55pm
Tut 35 - Superglobals
https://youtu.be/sMhSKNAHXZ8

- superglobals start with dollar sign and underscore ($_ )
- example: $_GET, $_POST, $_SERVER, $_SESSION, $_COOKIE etc

- $_SERVER['SERVER_NAME']
- $_SERVER['SCRIPT_FILENAME']
- $_SERVER['PHP_SELF']  
37. Linkman Pwa - Thu 3/Jun/2021, 5:18pm
Tut 36 - Superglobal: Sessions
https://youtu.be/6ZDTUZ1KRUI

$_SESSION
- Sessions - to carry over variables from a page to another page
- stores data in the server between page requests
- the session will last until we c1ose browser
- this tutorial will show how sessions work.
- start sessions with function - session_start()
- to de1ete one session value use - unset()
- to unser all session values use - session_unset()  
38. Linkman Pwa - Thu 3/Jun/2021, 5:25pm
Tut 37 - Null Coalescing
https://youtu.be/8Bsvrm4gHGs

- setting a default value to a variable
- this would prevent error if the value does not exist previously
- we will use double question mark (??)  
39. Linkman Pwa - Thu 3/Jun/2021, 5:40pm
Tut 38 - Superglobal: Cookies
https://youtu.be/GNGf-I5pNrI

$_COOKIE
- we use Sessions to track variable and keep in server
- we use Cookies to track variable and keep in user computer
- for sensitive data, using Sessions maybe safer than Cookies
- set a cookie with function - setcookie()  
40. Linkman Pwa - Thu 3/Jun/2021, 6:37pm
Tut 39 - File System (part 1)
https://youtu.be/yUzcYBuSgc4

- to read from txt file use function - readfile
- to check if file exist use - file_exists
- to duplicate file use - copy
- to check where is file - realpath
- to check file size - filesize
- to rename file - rename
- to make new directory - mkdir  
41. Linkman Pwa - Fri 4/Jun/2021, 11:43am
Tut 40 - File System (part 2)
https://youtu.be/UT9zKFYr18U

- the better way to open file, use function - fopen
- then read rh content using - fread
- to read a single line use - fgets
- to read a single character - fgetc
- to write into a file use - fwrite
- when finished, c1ose using - fc1ose
- to de1ete file use - unlink

to learn all the modes of fwrite check here:
https://www.w3schools.com/php/func_filesystem_fopen.asp  
42. Linkman Pwa - Fri 4/Jun/2021, 12:06pm
Tut 41 - Classes & Objects (part 1)
https://youtu.be/bt4znmLQCZ8

- intro to OOP
- what are Classes & Objects
- using __construct  
43. Linkman Pwa - Fri 4/Jun/2021, 12:20pm
Tut 42 - Classes & Objects (part 2)
https://youtu.be/BUdGWoMMPQs

- getter & setter
- still intro to OOP for beginners  
44. Linkman - Fri 4/Jun/2021, 12:30pm
harini saya dah tamat belajar php & mysql beginners level.. dan berjaya dapatkan blackbelt warna hijau thehe.. yahooo!!  

Page 1   (Total 44 comments)
Your Comment: Max 1000 characters.
Login Email:
Password:
Tips: Free Registration ¤ Lost Password?
Warning!
1. NEVER give UPFRONT PAYMENT (deposit) to any Money Lenders. Upfront Payment is 100% scam!
2. NEVER give advance payment to sellers you don't know or sellers with no office/home address.
3. NEVER pay for any products or services with CASH except for C.O.D!
4. Majalah.com NEVER send any business offers to anyone and we never offer our users' details for sale.
Disclaimer. Messages posted to our forum are solely the opinion and responsibility of the person posting the message. We assumes absolutely no responsibility for any loss (time/money/energy) as a result of using the information posted in this forum. We do not endorse, support, represent or guarantee the truthfulness, accuracy or reliability of any topics/messages posted here. We reserve the right to delete or edit your topics or comments. Your visiting of this site shall be deemed as your acceptance of this disclaimer.