Hi Guys,
I've found this tutorial http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/retrieve-data-from-a-mysql-database.aspx, which is great but it doesn't sound very secure? Basically the method they have is something like
opendb.php
closedb.php
selectdata.php
Having the user and password in the php doesn't sound very secure to me?
I've found this tutorial http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/retrieve-data-from-a-mysql-database.aspx, which is great but it doesn't sound very secure? Basically the method they have is something like
opendb.php
PHP:
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$conn = mysql_connect($dbhost,$dbuser,$dbpass) or die ('Error connecting to mysql');
$dbname = 'database';
mysql_select_db($dbname);
?>
closedb.php
PHP:
<?php
mysql_close($conn);
?>
selectdata.php
PHP:
<?php
include("opendb.php");
// Do some selection
include("closedb.php")
?>
Having the user and password in the php doesn't sound very secure to me?