Menu
Hi , my connect.php code which i use to connect to my mysql database is like below
<?php
$link = mysql_connect(‘localhost’, ‘root’, ‘34730’);
if (!$link) {
die(‘Could not connect: ‘ . mysql_error());
}
echo ‘Connected successfully<br>’;
$db_selected = mysql_select_db(‘sports’, $link);
if (!$db_selected) {
die (‘Can’t use : ‘ . mysql_error());
}
?>
i simply include connect.php to my other pages and it works perfectly .
However ,obviously if i run my website like this on the net , i will have security troubles for sure ..
Can anyone tell me a better and more sequre way of connecting to my database?
thanks