Re: pear DB

From: Date: Fri, 20 May 2005 05:08:35 +0000
Subject: Re: pear DB
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19293@lists.php.net to get a copy of this message
On 5/19/05, Anoop Bhat <abhat@interpublic.com> wrote: > Thanks for the quick response. > > also, is there anything in place that will tell me the operations that > are supported between certain db's with pear DB? > > for example, > > i used odbc to connect to a MSSQL server but the function numRows() was > not supported with pear DB odbc (which i believe is supported with the > unified odbc functions php.net/odbc). > > So, if i switched my dsn from mysql:// to odbc://, i would run into > problems that could potentially not even surface. > > I guess what i'm asking is, is there any way to know what > operations/functions are supported/unsupported between the different > phptypes for pear DB? > > I understand this question is pretty unclear and can be a little > ambigious as well. > If you'd looked at the driver you'd see that PEAR::DB does in fact try to get the # of rows. It's the ODBC extension that is failing. > > > Justin Patrin wrote: > > > On 5/18/05, Anoop Bhat <abhat@interpublic.com> wrote: > > > >>Is there any way to get the column names from a query? > >> > >>like mysql_field_name. > >> > >>The db i'm using is infact mysql but i haven't seen a function where i > >>can get the column names from the result of a query. > >> > >>is there some way to get the column names with pear DB? > >> > > > > > > Well, you can use tableInfo() on the statement handle. *or* you can > > use DB_FETCHMODE_ASSOC. > > > > $sth = $db->query($sql); > > while ($rec = $sth->fetchRow(DB_FETCHMODE_ASSOC)) { > > print_r($rec); > > } > > > > print_r($sth->tableInfo()); > > > This message contains information which may be confidential and privileged. > Unless you are the intended recipient (or authorized to receive this message > for the intended recipient), you may not use, copy, disseminate or disclose to > anyone the message or any information contained in the message. If you have > received the message in error, please advise the sender by reply e-mail, and > delete the message. Thank you very much. > (A) > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Justin Patrin

« previous php.pear.general (#19293) next »