At 03:56 AM 4/13/2001, Peter Harkins wrote:
> This generates a parse error:
> mysql_connect("localhost", "root", "rootpw") or
> return("bar");
>
> But all the following work fine:
> mysql_connect("localhost", "root", "rootpw") or die("bar");
>
> mysql_connect("localhost", "root", "rootpw") or
> print("bar");
>
> if (!mysql_connect("localhost", "root", "rootpw")) {
> return("bar");
> }
>
> Why? mysql_connect returns false on failure either way... I
> notice die
return isn't a function but a language construct. This is why the third
working line with the curlybraces works, and without them it doesn't.
include() is a language construct too. the particulars of using language
constructs (like return() and include()) with control structure syntax are
explained on the page for include().
http://us2.php.net/manual/en/function.include.php
-j (aka sneak)
----------------------------------------------
[EMAIL PROTECTED] - 0x514DB5CB
he who lives these words shall not taste death
becoming nothing yeah yeah
forever liquid cool
--
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]