It shows only bad practices of PHP and SQL. SO question were asked probably by novice programmers or amateurs. I'm a PHP developer. I use PDO or other data binding ORM/lib (ex. Eloquent ORM).
I build a startup for entrepreneurs who want to create a web or mobile app with no programming experience. For example you can create a wordpress clone or more complex apps like CRM without coding knowledge. Or you can buy an app and you can modify it for your needs.