Re: or die

From: Date: Fri, 21 Jul 2000 04:36:26 +0000
Subject: Re: or die
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-7515@lists.php.net to get a copy of this message
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 | > > >

« previous php.general (#7515) next »