Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.12.3

Bug #231 sybase fetchInto() returns incompatible data
Submitted: 2003-11-12 19:23 UTC
From: tpg at umich dot edu Assigned:
Status: Duplicate Package: DB
PHP Version: 4.3.3 OS: Solaris/Linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 31 + 44 = ?

 
 [2003-11-12 19:23 UTC] tpg at umich dot edu
Description: ------------ Sybase and mysql do not agree on the array being returned. Mysql returns a clean associative array. Sybase returns the same AND elements with numeric keys. So if the idea is this is supposed to present something transparent, then we must coerce the Sybase data to look like Mysql. Perhaps Mysql is the odd ball, but the lowest common denominator wins :-( or this needs to be documented so dummies like me know what is going on I've been using this fix in DB 1.3, 1.4 and now 1.5 function fetchInto($result, &$ar, $fetchmode, $rownum=null) { if ($rownum !== null) { if (!@sybase_data_seek($result, $rownum)) { return null; } } //$ar = ($fetchmode & DB_FETCHMODE_ASSOC) ? @sybase_fetch_array($result) : @sybase_fetch_row($result); $arr = ($fetchmode & DB_FETCHMODE_ASSOC) ? @sybase_fetch_array($result) : @sybase_fetch_row($result); if (!$ar) { // reported not work as seems that sybase_get_last_message() // always return a message here //if ($errmsg = sybase_get_last_message()) { // return $this->sybaseRaiseError($errmsg); //} else { return null; //} } // Sybase and mysql do not agree on the array being returned. // Mysql returns a clean associative array. // Sybase returns the same AND elements with numeric keys. // So if the idea is this is supposed to present something // transparent, then we must coerce the Sybase data to look // like Mysql. Perhaps Mysql is the odd ball, but the lowest // common denominator wins :-( or this needs to be documented // so dummies like me know what is going on $ar = array(); $i=0; while (list($col,$val) = each($arr)) { if ($col == $i) { $i++; } else { $ar[$col] = $val; } } return DB_OK; }

Comments

 [2003-12-16 06:36 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2003-12-20 17:27 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!