Because "PHP and MYSQL"

Asked

Viewed 692 times

-2

I started learning PHP very little time ago and I have done a lot of research on the subject. I have a question that may seem kind of obvious and "silly" to most of you. My doubt is, because most of the books/ courses I see on the internet "always" are with the name "PHP and Mysql" and courses and book of other languages does not have this addition of "and Mysql".

PHP is so dependent on DB like this, or has another explanation for it ?

  • PHP is the programming language, mysql is the database. They usually go together because most applications need to persist data, ie, store them in an organized way. You can do this by other means, but the database is definitely the best choice. But it is not impossible to make an application with only the language.

  • 10

    Because most people like to teach cake recipe instead of actually teach programming. More serious courses usually have more focus and teaches the foundation, teaches the person to think on their own, be creative, know how to solve any kind of problem, understand the basics to apply the right tool at the right time. But most prefer to be popular and this means giving people things ready to copy. It pleases more and "form" bad "professionals". Cake recipes need to be complete. Especially in PHP the fashion is to give the recipes and teach nothing.

  • For the ease of finding servers on the Internet that has support for these technologies, so there is a lot of material focusing on them 2. where a programming language , a database are important parts to make a form for example.

2 answers

4

Not that PHP is "so" database dependent, only that you can’t easily solve so many problems with just programming languages.

To quote an example that appears a lot here in Stackoverflow: how to email from forms. This is something you can do with just one programming language, you don’t need a database. But making a "bakery" system is already much more complicated to do without a database. It is not impossible, but it is also not easy, or desirable. This is because databases implement the acid model, that helps a lot when you don’t have control of parallel, competing requests. And that otherwise you would have to implement at hand in the absence of databases.

Basically the courses are selling "programming language and database" in an explicit way, since the combination of PHP and Mysql is quite common (see LAMP). The books that do not explicitly include a bank are probably explaining only the same language, while the courses probably teach bank, just not putting in the name of the course this.

1


First, PHP is a programming language and Mysql is a SGDB (database). Both are distinct and independent from each other.

The fact that you find many materials addressing both of them is because they are the most popular. Simply this.

Packets

What you will find most is materials with the LAMP or WAMP set:

L->Linux
A->Apache
M->MySQL
P->PHP

W->Windows
A->Apache
M->MySQL
P->PHP

Another popular set is XAMP

X->Windows, Linux, OS-X (mac)
A->Apache
M->MySQL
P->PHP

Why the LAMP set is so popular?

Simply because there are no licensing costs, they are open-source and can be used commercially.

But then you ask why there is little or almost no material for PGSQL (postgre)? After all it is also an open source database.

At this point we are talking about capitalism.

Capitalism, marketing

In an analogy, you have a bar where you offer 2 beers. One is popular and widely accepted the other is as good as but little known. To attract customers to your bar you will not put a poster on the door with the unknown brand of beer. Customers would go straight through and go to another bar where there is a poster with popular beer usually accompanied by the image of a famous person at the time.

That is, a book with title "php and mysql" will sell much more than a book "php postgre".

Hosting servers also give preference to the most popular and low-cost sets, in this case LAMP.

Mariadb

Obs: Currently you will find many packages encouraging Mariadb and discouraging the use of Mysql. This is a subject of long discussion and controversy so it is impossible to comment here. But basically Mariadb is Mysql. Born after a disagreement between the creator of Mysql and Oracle.

  • Thank you very much man. Of breaking I understood why these names XAMP, WAMP, LAMP.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.