note 85683 deleted from language.operators.logical by googleguy
| From: | googleguy@php.net | Date: | Sat, 01 Sep 2012 11:15:59 +0000 |
| Subject: | note 85683 deleted from language.operators.logical by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190395@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.