Re: Re: cvs: php4 /ext/mysql php_mysql.c
| From: | Peter Petermann | Date: | Thu, 06 Dec 2001 15:31:33 +0000 |
| Subject: | Re: Re: cvs: php4 /ext/mysql php_mysql.c | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-72754@lists.php.net to get a copy of this message | ||
Hi Andrey,
> What is the difference between :
> if (mysql_result && type==le_result && !mysql_eof(mysql_result)) {
> and
> if (mysql_result && type==le_result) {
> if (!mysql_eof(mysql_result)) {
> except the second is more readable :))))
if you would have quoted correct, you would read the diffrence between:
if (mysql_result && type==le_result && !mysql_eof(mysql_result)) {
php_error(E_NOTICE, "Called %s() without first fetching all rows from a
previous unbuffered query",
get_active_function_name(TSRMLS_C));
while (mysql_fetch_row(mysql_result));
zend_list_delete(mysql->active_result_id);
mysql->active_result_id = 0;
}
and
if (mysql_result && type==le_result) {
if (!mysql_eof(mysql_result)) {
php_error(E_NOTICE, "Called %s() without first fetching all rows
from a previous unbuffered query",
get_active_function_name(TSRMLS_C));
while (mysql_fetch_row(mysql_result));
}
zend_list_delete(mysql->active_result_id);
mysql->active_result_id = 0;
}
Now you can see, that in second case zend_list_delete &&
mysql->active_result_id
are executed even if mysql_eof(mysql_result)) == true
in first case not.
regards,
Peter "[DiSAStA]" Peterman