I am trying to access database by mysql procedure. It produces the following error. I know that array key have to define. I have done it but why it produces ..............
Use of undefined constant BLOG - assumed 'BLOG'
here is my code:
$config['db_host'] = 'localhost';
$config['db_user'] = 'root';
$config['db_pass'] = 'root';
$config['db_name'] = 'blog';
foreach ($config as $k => $v) {
define(strtoupper($k), $v);
}
mysql_select_db(BLOG);
I don't know what is the problem here.Any help will be appreciated.Thanks