note 14439 added to function.pg-exec.php
| From: | rvtol at isolution dot nl | Date: | Tue, 31 Jul 2001 14:12:06 +0000 |
| Subject: | note 14439 added to function.pg-exec.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-16101@lists.php.net to get a copy of this message | ||
Another update:
function sql_exec(&$resDB, &$strSQL)
{
..if (1)
..{
....ob_start(); // output buffer
....$r = pg_exec($resDB,$strSQL);
....if (($ob_len = ob_get_length()) > 0) $ob_val = ob_get_contents();
....ob_end_clean();
....if ($ob_len > 0)
....{
......if (1)
........$ob_val = ereg_replace( ':[ ]+', ':\n',
ereg_replace("\n|[<][/]?[A-Za-z]+[>]", '', AddSlashes($ob_val)));
......else
........$ob_val = str_replace( "\n", ' ', AddSlashes(pg_ErrorMessage()) );
......elnx('<SCRIPT LANGUAGE="JavaScript">', '<!--', '
window.alert("' . $ob_val . '")', '//-->',
'</SCRIPT>');
....}
..}
..else
..{
....$r = pg_exec($resDB, $strSQL);
..}
..return $r;
}
Change the 1st 'if (1)' to 'if (0)' for normal pg_exec().
Change the 2nd 'if (1)' to 'if (0)' for a more user-friendly message.
Ruud
http://www.php.net/manual/en/function.pg-exec.php