PHP MySQL
PHP MySQL
Apache
MySQL
PHP
php.net/manual/en/
Start:
1. Download @ www.wampserver.com
2. Download @ notepad-plus-plus.org
3. Install all Microsoft Visual C++ Redistribution 2008-2017 (if necessary)
4. Install and run WAMP – select browser and text editor.
Go to Localhost
Homepage
Tools PHP Info()
Ctrl+F search php.ini
Or
Ctrl+F search error reporting
Devp & Prod environment
On Off
Search output buffer
Change 4096 (prod) to off (devp)
Search timezone
http://www.php.net/manual/en/timezones.asia.php
Copy paste change UTC to Asia/Kuala_Lumpur
Save setting
Go to php info
Go to localhost phpmyadmin
To set DB only to MySQL (save memory used)
Login
Root
GO
Change password
Text Editor
Open Notepad++
Save at root directory
Embedding PHP Code on a Page
<?php … ?>
Eg:
To view source
Database
Browser Apache Server Find File Run php file convert to HTML Show on Browser
PHP
php.net/docs.net
Data Types
Variable
1. While loops
2. For loops
3. Foreach loops
4. Continue
5. Break
6. Understanding array pointers
Exercise Day 2
4
8
23
42
15
16
1 x 12 = 12
.
.
12 x 12 = 144
//ChineseZodiac
$year = 2018;
}
echo “{$year} is the year of the {zodiac}.<br />;
4. Change this IF statement to switch case
$a = 3;
$b = 4;