RE: [PHP] Failed MySQL queries
| From: | Jim Moseby | Date: | Wed, 05 Apr 2006 18:54:43 +0000 |
| Subject: | RE: [PHP] Failed MySQL queries | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-233296@lists.php.net to get a copy of this message | ||
>
> Rather than using the following, which simply displays a
> white screen with
> the die message, is there a way to add the die message to the
> body of the
> original form page, such as in a variable, so that I can
> display the message
> on the original form page with all the values already filled
> out, so that
> all the user has to do is resubmit?
>
> $result = mysql_query($query)
> or die("User Account could not be
> created. Please try again
> later.");
>
Yeah. Don't use die(). die() kills the script. You can use echo to echo a
message, but you'll have to handle any problems the failed query may cause.
JM