Re: Newbie ?: why this error?
| From: | CC Zona | Date: | Wed, 05 Sep 2001 04:45:00 +0000 |
| Subject: | Re: Newbie ?: why this error? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65985@lists.php.net to get a copy of this message | ||
In article <vickimills-334679.22185904092001@pb1.pair.com>,
vickimills@earthlink.net (Vicki) wrote:
> $db = mysql_connect ("hostname", "user", "password");
>
> if (!$db)
> {
> echo "Error: Could not connect to database. Please try again later.";
> exit;
> }
BTW, you can reduce that block down to a single line:
$db = mysql_connect ("hostname", "user", "password") or
die("Error: Could
not connect to database. Please try again later.");
See <http://php.net/die> for more info.
--
CC