PHP is a programming language that’s primarily used for server-side web programming. MySQL is a relational database.
The reasons you see them used together are as follows:
- Both are free and open-source
- Both are widely available on most web hosts (even shared hosting providers)
- PHP is used to create dynamic web pages, while MySQL is used to store and access data in a more convenient manner than flat files (see “why are databases better than flat files”). They play complementary roles on a server
Used together, you can create interesting, dynamic web sites (Wikipedia), applications (Facebook), and frameworks (WordPress).
solved PHP and MySQL are related to each other? [closed]