Re: DB_FETCHMODE_ASSOC returns an ordered array using MsSQL
| From: | Frederic Trudeau | Date: | Thu, 26 Feb 2004 23:10:24 +0000 |
| Subject: | Re: DB_FETCHMODE_ASSOC returns an ordered array using MsSQL | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-10975@lists.php.net to get a copy of this message | ||
Worse. I get an empty result set, no errors
I tried to debug via the output of the entire object, and I noticed that no
matter what I do, the fetchmode property is aleays set to 1 :
// snip
[prepared_queries] =>
[prepare_maxstmt] => 0
[last_query] => SELECT * FROM ispServiceType
[fetchmode] => 1
[fetchmode_object_class] => stdClass
[options] => Array
(
[persistent] =>
[ssl] =>
[debug] => 0
[seqname_format] => %s_seq
[autofree] =>
[portability] => 0
[optimize] => performance
)
\\ snip
----- Original Message -----
From: "David DiMaria" <ddimaria@eagledirect.com>
To: <pear-general@lists.php.net>
Sent: Thursday, February 26, 2004 6:03 PM
Subject: RE: [PEAR] DB_FETCHMODE_ASSOC returns an ordered array using MsSQL
> Try taking the off the single quotes: DB_FETCHMODE_ASSOC instead of
> 'DB_FETCHMODE_ASSOC'
>
> -David
>
> -----Original Message-----
> From: Frederic Trudeau [mailto:ftrudeau@zesolution.com]
> Sent: Thursday, February 26, 2004 4:00 PM
> To: pear-general@lists.php.net
> Subject: [PEAR] DB_FETCHMODE_ASSOC returns an ordered array using MsSQL
>
>
>
> Well, subject is pretty much self explanatory ...
>
> $db = DB::connect('mssql://dbuser:dbpass@dbhost/dbname')
> $sql = "SELECT * FROM sometable";
> $res = $db->query($sql)
> $row =& $res->fetchRow('DB_FETCHMODE_ASSOC');
> print_r($row);
>
> output is :
>
> Array
> (
> [0] => 75
> [1] => WOP_SSL
> [2] => 0
> [3] => {{wop_ssl}}
> [4] =>
> [5] => N
> [6] =>
> [7] => 0
> [8] =>
> [9] =>
> [10] => G
> [11] => NETWORK
> [12] => G
> [13] => NETWORK
> [14] => G
> [15] => NETWORK
> [16] =>
> [17] =>
> )
>
> help ? : )
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>