-7

Why do I get this error?

Call to undefined function mysql_real_escape_string()

Has it something to do with being old code?

Pang
  • 9,073
  • 146
  • 84
  • 117
Monk007
  • 19
  • 4

1 Answers1

0

Seems like you are using PHP 7, in which many new features were added and the already deprecated item, mysql_* were removed, thus, it would generate an function alert just as you faced. So use either, mysqli_* or PDO. But don't mix DB apis!

Ikari
  • 2,974
  • 3
  • 27
  • 34