PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect()
It looks like your code uses the mysql extension, and that extension is not present.
In other words, the error has nothing to do with SQL injection. The code for this app can't run given the PHP installation you have installed.
Run the command php --version
, you'll see something like this:
$ php --version
PHP 7.1.16 (cli) (built: Mar 31 2018 02:59:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
You probably you have PHP 7.0 or later, in which the mysql extension is no longer available. If that's the version of PHP you have, then you will have to change the code of your application, so that it uses either mysqli or PDO.
See these answers from 2016:
Editing code from the outdates mysql extension to the mysqli extension is pretty easy.
The other possibility is that you have PHP 5.6, but the installation is incomplete. You may be able to install an optional package to add the mysql extension to a PHP 5 installation. See this answer: