1

I'm working on a login form and am using some code from a tutorial. Now I don't remember what the mysql_prep was for and whether it's deprecated, since it's not mysqli... I couldn't really make sense of what I googled.

Is it ok to use this or should I use something else or not use it all together?

It looks like this (variables used to update SQL table):

$username = mysql_prep($_POST["username"]);
$password = mysql_prep($_POST["password"]);
$hashed_password = password_hash($_POST["password"], PASSWORD_DEFAULT);
Melvin
  • 329
  • 4
  • 20

1 Answers1

2

mysql_prep must be some user defined function. It does not exist in the php docs.

http://php.net/manual-lookup.php?pattern=mysql_prep&scope=quickref

Look inside this function in your own code and if it has any references to mysql_ functions then consider it deprecated. All mysql_ functions are deprecated as of PHP 5.5 and are removed in PHP 7.

Use mysqli_ functions or PDO instead.

Ryan Tuosto
  • 1,941
  • 15
  • 23