logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

ADoDb setFetchMode incompability: msg#00005

Subject: ADoDb setFetchMode incompability
Just installed phpwiki v1.3.12p configured to use
MySQL+AdoDB.

PHP 5.1.2
Mysql 4.1.21

When updating UserPreferences an "failed to insert"
sql error is thrown because of duplicate keys. Traced
problem to set|getPreferences functions in
lib\Adodb.php. Specifically, the use of associative
array to reference "prefs" field.

I changed the code as follows in both setPreferences
and getPreferences. I didn't see an clean way of
calling $db->SetFetchMode(ADODB_FETCH_ASSOC) given the
many different DBs supported.

// MJ - 11/24/06  - using associative array reference
here, but Adodb is not configured to that
// changing to numeric array reference
// change $prefs_blob = @$rs->fields['prefs']; to
$prefs_blob = @$rs->fields[0];

Sorry, if this email posted twice.

Hope this helps someone.

Thanks,
Maurice

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


<Prev in Thread] Current Thread [Next in Thread>