In php I am doing connection to the mysql database in a simple way like this
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
But I want a more professional way of database connection in an array
(where all the variable will be in an array) where I can use the variable like MySQL port number within that. So can someone kindly tell me how to do this? Any help and suggestions will be really appreciable. Thanks..