-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,564
  • 146
  • 81
  • 122
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
  • 3,176
  • 3
  • 29
  • 34