Post 01: The relationship between PHP and MySQLPHP CAKE PHP CODE IGNITER LARAVEL
Posted on 2016-08-17 22:07:23
PHP is a programming language used to build applications Website, or in other words it is the main language used for programming the server to handle the requirements of the client. And MySQL is a database management system for storing data and it is often used together with PHP since he was born, this is a perfect couple used to build websites.
Speaking as the perfect couple, but perhaps you do not know yet operational principles between us, right? To better understand this issue, we learn together offline.
1. Each contact between PHP and MySQL
Usually when you learn MySQL will learn T-SQL query as select, insert, update, delete. And I guess you'll be wondering if combined with PHP, then the query will be used to do this?
We see PHP as a normal human being, which means it can write out the query and execute the query it like you do. But the difference here is that you will catch PHP implementation of the query itself is not thought out.
Example : I want to get a list of all students in the school will write the query as follows.
Select * from students;
The results would execute the queries in PHP MY ADMIN is a list of students. So the question is if in PHP must do?
As we know MySQL is a database management system, it is safe for security, meaning that it functions User management, User authorization. So before entering PHP MY ADMIN is you must sign it.
So with PHP, there must be logged steps, then will be the definition of queries and finally execute and get results.
// STEP 1: CONNECT