I'm working on a live site that db host is set to localhost. How is that possible?
define('DB_HOST','localhost');
define('DB_USER','user');
define('DB_PASS','password');
define('DB_TABL','system');
define('DB_PREFIX','pre_');
$conn = new PDO(
'mysql:host='.DB_HOST.';dbname='.DB_TABL,
DB_USER,
DB_PASS,
array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
);
localhost
. Please note that localhost is with respect to the server where it is residing not with respect to your machine :) - Imran Zahoor