Re: wrong value from define

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Arthur wrote:
Hi,

in the following code, i want to get a constant value from config.php. I
don't receive the value, that is defined, but the name of the constant.
I tested the defines in config.php by echoing all defines, and it was
allright, so i'm quite confused why it doesn't work here.

That's my piece of code (which is in a class in a file which is in the same
dir as config.php):

function reg($name, $pw, $ally, $act) {
  include('config.php');
  echo(DB_SERV_NAME . '<br>');
  $dbp = mysql_connect(DB_SERV_NAME, DB_USR_NAME, DB_PW);
  if(!$dbp) die ("MySQL-Fehler");

Thats my error message:

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL Server Host
'DB_SERV_NAME' (11001) in
C:\apachefriends\xampp\htdocs\alliance\script\cl.member.php on line 34
MySQL-Fehler

Normally, i should get 'localhost'.
Anyone who can help me?
place this at the top of the file: error_reporting(E_ALL);

Either you don't define the consatnts properly or the include file doesn't exist.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux