The answer is simple and this information has been available long before the release of PHP 7. It has been removed and they suggest to move over to mysqli or PDO. For a complete list of changes you need to know about for migration see this guide.
Your options:
- Adjust your code to mysqli, which is quite the same just a little different. This wouldn't take long to adjust your code to.
- Switch over to PDO, quite different but more flexible and has my preference.
- The
mysql_* have been removed, meaning they are open to be redefined. You can create wrapper functions that refer to MySqli or PDO instead.
- Switch back to version 6 of PHP.
Why has it been removed?
- It's not under development.
- The
mysql_* functions provide just a piece of functionality of what MySQL really has to offer. (think about transactions, prepared statements, asynchronous queries, etc)
- People are still writing (even today) insecure code with those functions.
I'm not saying that using MySqli or PDO will magically prevent MySQL injections but at least they provide native support against those kind of attacks. The rest is up to you; the programmer, to make sure to point data where it needs to go.