Wednesday, 30 August 2017

mysql - What are some of the safest ways to connect to a database with PHP?

I'm still new to PHP and MYSQL and I'm trying to learn both with modern coding techniques. All the stuff I find online seems to be outdated.



Can anybody suggest anything for me? I am also curious if the below code is outdated? If it is indeed outdated, can you suggest newer and safer methods?




$connection = mysql_connect("localhost", "root", "");
if (!$connection) {
die("Oops, error happened: " . mysql_error());
}
?>

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...