cvs: pear /DB/DB sybase.php

From: Date: Wed, 31 Dec 2003 16:23:41 +0000
Subject: cvs: pear /DB/DB sybase.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-15241@lists.php.net to get a copy of this message
danielc Wed Dec 31 11:23:41 2003 EDT Modified files: /pear/DB/DB sybase.php Log: Make fetchInto() drop numbered keys when DB_FETCHMODE_ASSOC. Bug 350. Index: pear/DB/DB/sybase.php diff -u pear/DB/DB/sybase.php:1.19 pear/DB/DB/sybase.php:1.20 --- pear/DB/DB/sybase.php:1.19 Wed Dec 31 11:19:42 2003 +++ pear/DB/DB/sybase.php Wed Dec 31 11:23:41 2003 @@ -17,7 +17,7 @@ // | Antônio Carlos Venâncio Júnior <floripa@php.net> | // +----------------------------------------------------------------------+ // -// $Id: sybase.php,v 1.19 2003/12/31 16:19:42 danielc Exp $ +// $Id: sybase.php,v 1.20 2003/12/31 16:23:41 danielc Exp $ // // // TODO @@ -31,7 +31,7 @@ * extension. * * @package DB - * @version $Id: sybase.php,v 1.19 2003/12/31 16:19:42 danielc Exp $ + * @version $Id: sybase.php,v 1.20 2003/12/31 16:23:41 danielc Exp $ * @category Database * @author Sterling Hughes <sterling@php.net> * @author Antônio Carlos Venâncio Júnior <floripa@php.net> @@ -311,7 +311,17 @@ } } if ($fetchmode & DB_FETCHMODE_ASSOC) { - $ar = @sybase_fetch_array($result); + if (function_exists('sybase_fetch_assoc')) { + $ar = @sybase_fetch_assoc($result); + } else { + if ($ar = @sybase_fetch_array($result)) { + foreach ($ar as $key => $value) { + if (is_int($key)) { + unset($ar[$key]); + } + } + } + } if ($this->options['optimize'] == 'portability' && $ar) { $ar = array_change_key_case($ar, CASE_LOWER); }

« previous php.pear.cvs (#15241) next »