0

I get this error:

"Fatal error: Uncaught Error: Call to undefined function mysql() in C:\xampp\htdocs\bnet-form\form.php:4 Stack trace: #0 {main} thrown in C:\xampp\htdocs\bnet-form\form.php on line 4" error message.

What should I do?

image here

Zoe
  • 27,060
  • 21
  • 118
  • 148
  • mysql_* functions are deprecated as of PHP 5.5.0, and removed as of PHP 7.0.0. Switch your code to use [PDO](https://secure.php.net/manual/en/pdo.prepared-statements.php) or [mysqli](http://php.net/manual/en/mysqli.quickstart.prepared-statements.php) instead. – aynber May 24 '18 at 17:58
  • 2
    `mysql` was never a function. Maybe you meant http://php.net/manual/en/function.mysqli-connect.php ` – user3783243 May 24 '18 at 18:08
  • 1
    Additionally: unless you explicitly want GIF answers, don't post code as images. – mario May 24 '18 at 18:17
  • Your script is wide open to [SQL Injection Attack](http://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php) Even [if you are escaping inputs, its not safe!](http://stackoverflow.com/questions/5741187/sql-injection-that-gets-around-mysql-real-escape-string) Use [prepared parameterized statements](http://php.net/manual/en/mysqli.quickstart.prepared-statements.php) in either the `MYSQLI_` or `PDO` API's – RiggsFolly May 24 '18 at 18:42
  • Please dont __roll your own__ password hashing specially not using MD5(). PHP provides [`password_hash()`](http://php.net/manual/en/function.password-hash.php) and [`password_verify()`](http://php.net/manual/en/function.password-verify.php) please use them. And here are some [good ideas about passwords](https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet) If you are using a PHP version prior to 5.5 [there is a compatibility pack available here](https://github.com/ircmaxell/password_compat) – RiggsFolly May 24 '18 at 18:42

0 Answers0