I have a website that uses php to access an SQL database. It works fine and I have added various checks to make sure the user is logged in to access the required webpages etc and I am happy with that.
My question is, when they get to the reporting part of the website that uses php to access the SQL database the database username and password are passed in the php file:
$username = "username";
$password = "password";
$con = mysql_connect(localhost, $username, $password) or die(mysql_error());
Is this bad practice - is there a security risk? And if so what are the ways around it?
Many thanks