Re: Problem with DB
| From: | Pablo Dall'Oglio | Date: | Thu, 03 Oct 2002 17:51:27 +0000 |
| Subject: | Re: Problem with DB | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-2426@lists.php.net to get a copy of this message | ||
On Fri, 13 Sep 2002 12:11:07 +0200
Marcos Lois Bermúdez <marcos.lois@iqc-services.com> wrote:
> I make a project using PEAR DB, in start i use MySQL, in a object table i use:
> $res = $db->query("SELECT * .....");
> $cols = $res->tableInfo();
> _
> _
> _
> while($row = $res->fetchRow()) {
> _
> _
> }
> $res->free();
>
> And this work fine, but if i change the database to Postgress, it fails and
> don't return any data, and the problem is the $cols = $res->tableInfo();
> call, if i comment this out the result returns the rows, for solve this
> problem temporally, i use this method, but it seem no eficient, anybody
> have the same trouble.
>
> $res = $db->query("SELECT * .....");
> $cols = $res->tableInfo();
> $res->free();
> $res = $db->query("SELECT * .....");
> _
> _
> _
> while($row = $res->fetchRow()) {
> _
> _
> }
> $res->free();
I'm not sure but I think tableInfo runs a kind of fetchRow and let the DB pointer at the end or
query.... please, runs fetchRow before...
Pablo
>
> Any help will be apreciated.
>
> Regards
>
> -----------------------------------------------
> Marcos Lois Bermúdez
> marcos.lois@iqc-services.com
> IQC - Services
> Avda. Garcia Barbón, 90 / 4ºB
> 36201 Vigo (Pontevedra)
> Tel: +34 986.884.244
> Fax: +34 986.415.074
> http://www.iqc-services.com
> -----------------------------------------------
>
>
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
+--------------------------------------------------+
| _ Pablo Dall'Oglio (pablo@php.net) |
| °v° Univates - IT Department +55 51 3714-7040 |
| /(_)\ The best source is the source code |
| ^ ^ Linux User n.223253, Lajeado, RS - Brasil |
+--------------------------------------------------+
: Programmer, pilot, wine taster and a half musician