RE: [PHP] passing mysql_error() out put to a different page?

From: Date: Tue, 15 Oct 2002 23:47:44 +0000
Subject: RE: [PHP] passing mysql_error() out put to a different page?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-120083@lists.php.net to get a copy of this message
> Well, the die() function takes a limited number of parameters, which as > you > noted is why it doesn't like the assignment of the mysql_error() and the > header > statements both inside the die() function. So, why not something like > this: > > $res = mysql_query(.....); > if ($res == FALSE) //which is what I _believe_ die() looks at > /* or at least this is what the manual says the function returns on a > query > error */ > { > $error = mysql_error(); > Header("Location: logerror.php?op=insert_error&err_value=$error"); If you do it this way, you'll want to urlencode(), rawurlencode(), or base64_encode() the $error. You only have to decode on the receiving end if you use the base64_encode. ---John Holmes...

« previous php.general (#120083) next »