And I can guarantee you, from personal experience, that PHP is not the only language in which string concatenation with variables is the most common means of writing SQL queries.
It is true that in both cases, eventually top notch engineers got involved in the projects’ core and cleaned things up to the extent possible. But it’s a heck of a lot easier to improve a spec than a culture.
Also, it is much faster than the suggested alternative (pdo).
https://dev.mysql.com/doc/refman/5.5/en/mysql-real-escape-st...
https://stackoverflow.com/questions/16859477/why-are-phps-my...
[1] https://dev.mysql.com/doc/refman/8.0/en/mysql-escape-string....