Hi
this is db.php
<?
define('DB_SERVER','localhost');
define('DB_SERVER_USERNAME','root');
define('DB_SERVER_PASSWORD','root');
define('DB_DATABASE','osc');
?>
and this is index.php
<?php
include("db.php");
tep_db_connect() or die('Unable to connect to database server!');
function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
global $$link;
if (USE_PCONNECT == 'true') {
$$link = mysql_pconnect($server, $username, $password);
} else {
$$link = mysql_connect($server, $username, $password);
}
if ($$link) mysql_select_db($database);
return $$link;
}
?>
I am getting errors like
Use of undefined constant DB_SERVER - assumed 'DB_SERVER' in C:\Program Files\Apache Group\Apache2\htdocs\php_test\$$test.php on line 14
Can someone tell me why it is not able to recognize the variables
Also, whats the significance of the $$link
Is that a special variabel in php?
Why cant we simply use $link?
Thanks