Re: [PHP]include question, WHY doesn't this work...

2001-07-23 Thread Unni

Is the lib direcotory under the working directory, I mean, if your 
program is excuting  under temp directory, the lib directory has to be 
below temp directory. If you are running this program from the root 
directory then lib has to be below root directory.
Your code looks good to me.
One more thing I can think of is, do you read access to lib directory, 
just curious.

Chris Cocuzzo wrote:

 hey-
 
 I have a piece of code which does a simply INSERT query into an mp3 table.
 I've tested it out, and it completes the query, however there is one bug
 that I just have no clue about.
 
 this code does not work when i try to connect to the db:
 include(lib/db_config.php);
 
 $connection = db_connect(fplg);
 if(!connection) {
  die(sql_error());
 }
 the include fails and so the db_connect function is undefined.
 
 this code works:
 include(db_config.php);
 
 $connection = db_connect(fplg);
 if(!connection) {
  die(sql_error());
 }
 
 I DO have a directory called lib in my root folder. am I calling the include
 wrong in that first piece. Note that I also tried the first one with a
 foward slash in front of the 'lib', but had no luck.
 
 help!
 chris
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP]include question, WHY doesn't this work...

2001-07-23 Thread Chris Cocuzzo

the lib directory is under the root directory, or the www directory, where
all the normal files have been put. i figured out that the include worked
better when I specified the entire system path.

chris


- Original Message -
From: Unni [EMAIL PROTECTED]
To: Chris Cocuzzo [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, July 23, 2001 3:52 PM
Subject: Re: [PHP]include question, WHY doesn't this work...


 Is the lib direcotory under the working directory, I mean, if your
 program is excuting  under temp directory, the lib directory has to be
 below temp directory. If you are running this program from the root
 directory then lib has to be below root directory.
 Your code looks good to me.
 One more thing I can think of is, do you read access to lib directory,
 just curious.

 Chris Cocuzzo wrote:

  hey-
 
  I have a piece of code which does a simply INSERT query into an mp3
table.
  I've tested it out, and it completes the query, however there is one bug
  that I just have no clue about.
 
  this code does not work when i try to connect to the db:
  include(lib/db_config.php);
 
  $connection = db_connect(fplg);
  if(!connection) {
   die(sql_error());
  }
  the include fails and so the db_connect function is undefined.
 
  this code works:
  include(db_config.php);
 
  $connection = db_connect(fplg);
  if(!connection) {
   die(sql_error());
  }
 
  I DO have a directory called lib in my root folder. am I calling the
include
  wrong in that first piece. Note that I also tried the first one with a
  foward slash in front of the 'lib', but had no luck.
 
  help!
  chris
 
 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP]include question, WHY doesn't this work...

2001-07-23 Thread Gonyou, Austin

have you tried giving the absolute path to the included file? 

include(/some/path/to/a/file.php);



-- 
Austin Gonyou
Systems Architect, CCNA
Coremetrics, Inc.
Phone: 512-796-9023
email: [EMAIL PROTECTED] 

 -Original Message-
 From: Unni [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 23, 2001 2:53 PM
 To: Chris Cocuzzo
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP]include question, WHY doesn't this work...
 
 
 Is the lib direcotory under the working directory, I mean, if your 
 program is excuting  under temp directory, the lib directory 
 has to be 
 below temp directory. If you are running this program from the root 
 directory then lib has to be below root directory.
 Your code looks good to me.
 One more thing I can think of is, do you read access to lib 
 directory, 
 just curious.
 
 Chris Cocuzzo wrote:
 
  hey-
  
  I have a piece of code which does a simply INSERT query 
 into an mp3 table.
  I've tested it out, and it completes the query, however 
 there is one bug
  that I just have no clue about.
  
  this code does not work when i try to connect to the db:
  include(lib/db_config.php);
  
  $connection = db_connect(fplg);
  if(!connection) {
   die(sql_error());
  }
  the include fails and so the db_connect function is undefined.
  
  this code works:
  include(db_config.php);
  
  $connection = db_connect(fplg);
  if(!connection) {
   die(sql_error());
  }
  
  I DO have a directory called lib in my root folder. am I 
 calling the include
  wrong in that first piece. Note that I also tried the first 
 one with a
  foward slash in front of the 'lib', but had no luck.
  
  help!
  chris
  
  
  
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]