[Typo3-dev] SQL wrapper functions
John Begley
John.Begley at hummingbird.com
Tue Nov 2 18:21:36 CET 2004
I have switched to use the typo3 sql wrapper functions but am receiving the
following warnings:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result
resource in D:\TYPO3\dummy-3.7.0\t3lib\class.t3lib_db.php on line 723
Here is some sample code where this happens:
$link = $GLOBALS['TYPO3_DB']->sql_pconnect("localhost", "root", "") or
die("Could not connect : ");
$GLOBALS['TYPO3_DB']->sql_select_db("test") or die("Could not select
database");
$query="select * from items ORDER BY name";
$result=$GLOBALS['TYPO3_DB']->sql_query($query);
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))
{ ... }
I understand I may be getting a DBAL object back from the sql_query function
here - but I don't understand why this does not quality also as a valid
result resource. Am I doing something wrong or will I need to suppress
these warnings?
John
More information about the TYPO3-dev
mailing list