Re: or die

From: Date: Sat, 04 May 2002 12:45:01 +0000
Subject: Re: or die
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-13535@lists.php.net to get a copy of this message
The first example fixed: $link = mysql_pconnect ("localhost", "sa", "sa") or die ("Could not connect"); or die is an option of mysql_pconnect so you don´t need the {}. In the second example you can use {} for the if. []´s Waldemar ----- Original Message ----- From: "Raidell Avello" <ravello@ucfinfo.ucf.edu.cu> To: <php-windows@lists.php.net> Sent: Saturday, May 04, 2002 1:33 PM Subject: [PHP-WIN] or die > hi > a have this code > $link = mysql_pconnect ("localhost", "sa", "sa") { > or die ("Could not connect"); > } > and i receive > Parse error: parse error in c:\htdocs\otra.php on line 2 > > and rewrite the code like this > if (!$link = mysql_pconnect ("localhost", "sa", "sa")) { > echo "Could not connect"; > } > and work > what's wrong??? > regards > RAM > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.windows (#13535) next »