What is PHP?
PHP is the most popular server side scripting language. It is fast and very flexible and PHP powers just about everything from blog post to some of the most popular websites in the world. One example of how accepted PHP is, as well as how developers admire its flexibility is the WordPress program.
Originally created by Danish-Canadian programmer Rasmus Lerdorf, PHP primarily took off in Israel by Andi Gutmans and fellow Technion student Zeev Suraski, who created the Zend Engine, the core component for PHP 4.
PHP 7 was introduced in December 2015; however, we will concentrate on PHP 5.6, as it is the more stable version at this time.
How to Install PHP/MySQL
The recommended application to use for running Apache/PHP MySQL is Xampp (pronounced Champp). You can download the app at www.apachefriends.org.
Once downloaded, you can run it by clicking the completed download at the bottom left of the screen for Chrome. For Internet Explorer, click See All Downloads.
If you have an antivirus program, you may be prompted that a new application is trying to load on your machine. Click Yes to continue.
Click OK or Yes to all requests during the loading of the program.
Once the Xampp program has completed its installation, you will need to do the following:
Locate the Program
- Search in Windows for ‘XAMPP’ or locate it in the System Tray
- You will see a response for XAMPP Control Panel
- Click the link
- The app is the control panel that is used to Start the programs. They are off by default.
- Click Start for Apache and Start for MySQL
- Type http://localhost/phpmyadmin in the URL
- PHPMyAdmin will then show up
- It is important that you get very familiar with this application, as it is the front-end for the SQL process
- Working with PHPMyAdmin
- The Databases
- On the left window pane you will see the list of the four default databases created when the program was installed.
- You can view them but you will not be making any changes here. These databases are what makes PHPMYAdmin work.
- The Tables
- Under each database (click the + sign to expand) are a list of tables that belong to that database.
- Click a table
- Click the Structure tab and the list of columns will appear
- Click the SQL tab and you will see the actual SQL query
- Creating A New Database
- Click New at the top left
- A form will appear that will allow you to create the new database
- Enter the information
- Creating the Table
- Once the database is created,a new page will appear which will ask you for the Table name
- Enter a Table name and the number of columns you expect will exist in the table (you can always add more)
- you will see it added to the left window pane
- Additionally, the link New will also appear indented under it
- This is where you will create your tables for the database
- Click New
- Enter the information in the fields that apply to your table