RE: [PHP] or die

From: Date: Fri, 21 Jul 2000 20:40:39 +0000
Subject: RE: [PHP] or die
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-7533@lists.php.net to get a copy of this message
Could you just... mysql_connect("host", "user", "passwd") or mysql_pconnect("host","user","passwd"); ?? I'm not sure if "or die" is what the parser will look for, or if it is broken down further so that "or" is the construct and die() is just a function. Could you even do? mysql_connect("host", "user", "passwd") or mysql_pconnect("host","user","passwd") or die("Die"); John -----Original Message----- From: Erik [mailto:stainsby@telus.net] Sent: Friday, July 21, 2000 12:36 AM To: Darrell Brogdon; tyler.longren@midiowa.net Cc: PHP-General Subject: Re: [PHP] or die >From the manual: die die -- Output a message and terminate the current script Description: void die(string message); This language construct outputs a message and terminates parsing of the script. It does not return. --- The string may be replaced with a function call I suppose, but the script would terminate as soon as it was completed, so you can't use this to make a connection in the case of a failed query attempt. Regards, Erik Stainsby network tech by day php hacker by night beer drinker at any time ----- Original Message ----- From: "Darrell Brogdon" <dbrogdon@valinux.com> To: <tyler.longren@midiowa.net> Cc: "PHP-General" <php-general@lists.php.net> Sent: Thursday, July 20, 2000 11:51 PM Subject: Re: [PHP] or die > Removing the quotes from around the function should work. > > <?php > mysql_connect("host","user","passwd") > or die( mysql_pconnect("host","user","passwd") ); > ?> > > -Darrell > > > Tyler Longren wrote: > > > Hello all- > > > > I was wondering if the following is possible: > > > > <? > > mysql_connect("host","user","passwd") or die > > ("mysql_pconnect("host","user","passwd")"); > > ?> > > Can functions be put inside of the "or die()"? Or does it HAVE to be a > > text string? > > > > Thanks, > > Tyler Longren > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > -- > | Darrell Brogdon | http://www.sourceforge.net | > | Web Developer | http://www.valinux.com | > | VA Linux Systems, Inc. | http://darrell.brogdon.net | > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#7533) next »