Project

General

Profile

Actions

Bug #16322

closed

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in ...

Added by edwin over 18 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Won't have this time
Assignee:
-
Category:
-
Target version:
-
Start date:
2006-07-05
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Because there is nothing in the database which can be selected througth the select statement, made by exec_SELECTquery(). Than there is nothing to sql_fetch_assoc() so you get an error. Problem can be sloved by useing the @-sign. I report this because i've seen more functions where the same problem can be found.

I've found the problem in t3lib\class.t3lib_page.php getHash($hash,$expTime=0)

$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('content', 'cache_hash', 'hash='.$GLOBALS['TYPO3_DB']->fullQuoteStr($hash, 'cache_hash').$whereAdd);
if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$GLOBALS['TYPO3_DB']->sql_free_result($res);
return $row['content'];
}

i've also another question, what is happening if $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res) is false? Than nothing is returned.
(issue imported from #M3794)


Files

3794-1.diff (482 Bytes) 3794-1.diff Administrator Admin, 2009-02-06 11:00
Actions

Also available in: Atom PDF