#106 db_mysql function free() causes warning

open
nobody
DB_SQL (15)
5
2002-11-13
2002-11-13
Anonymous
No

When executing a second query after a query executing
an "insert", "delete" or "update" statement using the
same db-object, free() calls mysql_free_result() on an
invalid resource-id.

cause: mysql_(db)_query() returns no resource_id
but "true"/"false" on executing "insert", "delete"
or "update" statements. query() tries to free() them.

result: php warning:
"mysql_free_result(): supplied argument is not a valid
MySQL result resource"

(possible?) solution:
in function query():

instead of:
# New query, discard previous result.
if ($this->Query_ID) {
$this->free();
}

use:
# New query, discard previous result.
if ($this->Query_ID && ($this->Query_ID !==true)) {
$this->free();
}

Discussion