note 21677 deleted from function.odbc-fetch-into by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 09:02:28 +0000 |
| Subject: | note 21677 deleted from function.odbc-fetch-into by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196844@lists.php.net to get a copy of this message | ||
Note Submitter: danielc at analysisandsolutions dot com
----
Here's a workaround to ensure your program works regardless
of which version of PHP you're running.
The silly eval() process is needed to prevent Warning
messages in newer versions.
<?php
$php_errormsg = '';
if ( phpversion() < '4.2.0') {
$Code = 'if ( !@odbc_fetch_into($Results, $Row, &$Temp)
AND $php_errormsg != "") {';
$Code .= ' echo $php_errormsg;';
$Code .= ' exit();';
$Code .= '}';
eval($Code);
} else {
if ( !@odbc_fetch_into($Results, $Temp)
AND $php_errormsg != '') {
echo $php_errormsg;
exit();
}
}
?>