note 85682 deleted from language.operators.logical by thiago
| From: | thiago@php.net | Date: | Fri, 12 Sep 2008 04:36:07 +0000 |
| Subject: | note 85682 deleted from language.operators.logical by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-144354@lists.php.net to get a copy of this message | ||
Note Submitter: sandaimespaceman at gmail dot com
----
There's one userful way to use the or operator:
<?php
//If the connection was success, "Connected to database" will be shown.
//If the connection was failed, "Unable to connect" will be shown.(NOTE: The @ will hide
error messages)
@mysql_connect("localhost", "root", "password") or die("Unable to
connect");
echo "Connected to database";
?>
So you don't need to use if operators to add more lines.