Re: Newbie ?: why this error?
| From: | Gary | Date: | Wed, 05 Sep 2001 14:20:08 +0000 |
| Subject: | Re: Newbie ?: why this error? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-66037@lists.php.net to get a copy of this message | ||
Cc Zona wrote:
In article <vickimills-334679.22185904092001@pb1.pair.com>, vickimills@earthlink.net (Vicki) wrote:echo the error. $db = mysql_connect ("hostname", "user", "password"); echo mysql_errno().": ".mysql_error()."<BR>"; Then you will know what the problem is. BTW if you are using the Dreamweaver extension that shows you the includes, get rid of it. It will rewrite your includes where they are all the same. Gary$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.");