php-windows Digest 17 Dec 2004 14:46:12 -0000 Issue 2509

Topics (messages 25166 through 25168):

Re: newbie: a very simple question (I hope)
        25166 by: Michael Adams

Problems with require.
        25167 by: s
        25168 by: Jason Barnett

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
On Wed, 15 Dec 2004 10:23:29 -0800 (PST)
Patrick Roane <[EMAIL PROTECTED]> wrote:

> I am trying some excercises in a book and one of the
> excercises says to:
> 
> Assign values to two variables. Use comparison
> operators to test whether the first value is:
> 
> 1. the same as the second
> 
> 2. less than the second
> 
> 3. Print the result of each test to the browser.
> 
> My question is, how do I print the result? For
> example, say I use the following expression:
> 
> $x = 3;
> ++$x < 4; // false
> print $x;
> 
> I know how to print out the value of $x, but not the
> test result of 'true or false'.  
> 
> Thanks-
> 

Wrap it in an 'if'

$x = 3;
if (++$x < 4) {
        echo 'result is true';
} else {
        echo 'result is false';
}

echo and print are largely interchangable

Michael

--- End Message ---
--- Begin Message ---
Im having a problem that im assuming is related to my core PHP code
rather than the pear file I am trying to include (though if you folks
think I need to look into that, thats ok too). Basically im seeing the
following when I try to load my page:

Warning: main(DB.php) [function.main]: failed to open stream: No such
file or directory in c:\wamp\www\testing\Ch4\test_dbi.php on line 26

Fatal error: main() [function.require]: Failed opening required 'DB.php'
(include_path=':c:/wamp/www/PEAR:c:/wamp/www/phplib:c:/wamp/www/testing/ch4/class:.;C:\php5\pear')
in c:\wamp\www\testing\Ch4\test_dbi.php on line 26

The line in question is:

require_once 'DB.php';

I have added the path to my PEAR directory thru the path command, though
when I print out the contents for my $PEAR_DIR variable it shows as :
c:/wamp/www/PEAR. Not sure if it matters that the slashes are
linux-style or not, but I thought I would point that out. I browsed to
the directory and DB.php does exist there and I have even tried hard
coding the full path ( i.e. require_once 'c:\wamp\www\PEAR\DB.php' and
also with /'s instead of \'s) and it still nets the same errors. Anyone
have any idea why this is happening?



What power would hell have if those imprisoned here would not be able to dream 
of heaven?

--- End Message ---
--- Begin Message --- S wrote:
Im having a problem that im assuming is related to my core PHP code
rather than the pear file I am trying to include (though if you folks
think I need to look into that, thats ok too). Basically im seeing the
following when I try to load my page:

Warning: main(DB.php) [function.main]: failed to open stream: No such
file or directory in c:\wamp\www\testing\Ch4\test_dbi.php on line 26

Fatal error: main() [function.require]: Failed opening required 'DB.php'

(include_path=':c:/wamp/www/PEAR:c:/wamp/www/phplib:c:/wamp/www/testing/ch4/class:.;C:\php5\pear')

I think you need to change your seperator to a semilcolon instead ;)

Go to your php.ini (wherever you keep it) and change your include path to this:
include_path='c:/wamp/www/PEAR;c:/wamp/www/phplib;c:/wamp/www/testing/ch4/class;.;C:/php5/pear'


Forward slashes are not a problem for me, but then again I use Apache YMMV

Strange, do you have two PEAR installations? You should only need one unless you're trying to maintain a testing tree and a production tree.
--- End Message ---

Reply via email to