Re: Help with SQL2XML
| From: | Tomas V.V.Cox | Date: | Mon, 01 Apr 2002 22:39:16 +0000 |
| Subject: | Re: Help with SQL2XML | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1069@lists.php.net to get a copy of this message | ||
tableInfo() can output info from the result of a query or from a table.
For ex:
$res = $db->query($sql);
print_r($res->tableInfo());
$db->tableInfo('users_table');
Unfortunatly Postgres doesn't support info from results only from tables
(and it is emulated).
Tomas V.V.Cox
Ken Harris wrote:
>
> Is anyone using this module, especially with Postgresql? I have tried to use
> it and only get an empty xml string back. The documentation says that the
> database needs a tableInfo function (which Postgresql has) in the DB module.
>
> I have tried both the direct and indirect methods:
> $myclass = new xml_sql2xml
> ( "pgsql://username:password@host5432/databasename" );
> $xmlstring = $myclass->getxml( $sql );
> AND
> $db = DB::connect ( "pgsql://username:password@host5432/databasename" );
> $result = $dbh->query ( "SELECT * FROM users" );
> $myclass = new xml_sql2xml ( $db );
> $xmlstring = $myclass->getxml( $result );
>
> I get the same results in both cases:
>
> <?xml version="1.0"?>
> <root><result></result></root>
>
> Any help would be appreciated.
>
> Ken Harris
> Senior Analyst
> Lighthouse Information Systems, Inc
> (410) 239-9591