> My first line of PHP code (embedded in HTML) has:
>
> $db = mysql_connect("x","y","z") or
> die("saysomethinghere");
>
> If I have a connection problem, it does print the
> "die" message and the connection error, but it also
> stops the page right there: no more HTML is displayed.

Well, you've mentioned your problem right here.  'or die (
"saysomethinghere" );'.  Die meaing just that. "Die".  Don't process
anything further.

> I know about suppressing the error message with "@"
> but this wouldn't seem to help this problem.

Try something like:

$db = mysql_connect("X", "Y", "Z");
$db_error = mysql_errno();
if ($db_error <> 0) {
    print "Error conencting to the database";
    $db_error = 1;
} else {
    # Do the rest of your MySQL Queries etc. here
    # or do checks to make sure $db_error is 0 prior
    # to doing any...
}

hope this helps, or atleast points you in the right direction for
resolution.

bkx



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to