Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.3.4

Bug #576 sql2xml xml-resultset without values
Submitted: 2004-01-14 16:30 UTC
From: fsteinel Assigned: ifeghali
Status: Closed Package: XML_sql2xml
PHP Version: Irrelevant OS: unix
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 29 - 25 = ?

 
 [2004-01-14 16:30 UTC] fsteinel
Description: ------------ php 4.3.1 pear 1.2.1 DB 1.5.0RC2 XML_sql2xml 0.3.1 Reproduce code: --------------- <?php include_once ("DB.php"); include_once("XML/sql2xml.php"); $db = DB::connect("pgsql://name:pass@localhost/test"); $sql2xml = new xml_sql2xml(); $sql2xml->setEncoding("ISO-8859-1","UTF-8"); $result = $db->query("select * from jonah_channels LIMIT 1"); $xmlstring = $sql2xml->getXML($result); print_r($result); echo "---\n"; echo $xmlstring; echo "===\n"; $result = $db->query("select * from jonah_channels LIMIT 1"); $res=$result->fetchRow(); print_r($res); ?> Expected result: ---------------- db_result Object ( [dbh] => db_pgsql Object ( [connection] => Resource id #8 [phptype] => pgsql [dbsyntax] => pgsql [prepare_tokens] => Array ( ) [prepare_types] => Array ( ) [transaction_opcount] => 0 [dsn] => Array ( [phptype] => pgsql [dbsyntax] => pgsql [username] => name [password] => pass [protocol] => tcp [hostspec] => localhost [port] => [socket] => [database] => test ) [row] => Array ( [11] => 1 ) [num_rows] => Array ( [11] => 1 ) [affected] => 0 [autocommit] => 1 [fetchmode] => 1 [_debug] => [_default_error_mode] => [_default_error_options] => [_default_error_handler] => [_error_class] => DB_Error [_expected_errors] => Array ( ) [features] => Array ( [prepare] => [pconnect] => 1 [transactions] => 1 [limit] => alter ) [errorcode_map] => Array ( ) [type] => [prepared_queries] => [prepare_maxstmt] => 0 [last_query] => select * from jonah_channels LIMIT 1 [fetchmode_object_class] => stdClass [options] => Array ( [persistent] => [optimize] => performance [debug] => 0 [seqname_format] => %s_seq [autofree] => ) [dbh] => ) [result] => Resource id #11 [row_counter] => [limit_from] => [limit_count] => [limit_type] => alter [autofree] => [fetchmode] => 1 [fetchmode_object_class] => stdClass ) --- <?xml version="1.0"?> <root> <result> <row> <channel_id>2</channel_id> <channel_name>Top Stories</channel_name> <channel_type>1</channel_type> <channel_desc></channel_desc> <channel_interval>86400</channel_interval> <channel_url></channel_url> <channel_link>http://p.moreover.com/cgi-local/page?index_topstories+rss</channel_link> <channel_img>moreover.gif</channel_img> <channel_updated>0</channel_updated> </row> </result> </root> === Array ( [0] => 2 [1] => Top Stories [2] => 1 [3] => [4] => 86400 [5] => http://p.moreover.com/cgi-local/page?index_topstories+rss [6] => [7] => moreover.gif [8] => 0 ) Actual result: -------------- db_result Object ( [dbh] => db_pgsql Object ( [connection] => Resource id #8 [phptype] => pgsql [dbsyntax] => pgsql [prepare_tokens] => Array ( ) [prepare_types] => Array ( ) [transaction_opcount] => 0 [dsn] => Array ( [phptype] => pgsql [dbsyntax] => pgsql [username] => name [password] => pass [protocol] => tcp [hostspec] => localhost [port] => [socket] => [database] => test ) [row] => Array ( [11] => 1 ) [num_rows] => Array ( [11] => 1 ) [affected] => 0 [autocommit] => 1 [fetchmode] => 1 [_debug] => [_default_error_mode] => [_default_error_options] => [_default_error_handler] => [_error_class] => DB_Error [_expected_errors] => Array ( ) [features] => Array ( [prepare] => [pconnect] => 1 [transactions] => 1 [limit] => alter ) [errorcode_map] => Array ( ) [type] => [prepared_queries] => [prepare_maxstmt] => 0 [last_query] => select * from jonah_channels LIMIT 1 [fetchmode_object_class] => stdClass [options] => Array ( [persistent] => [optimize] => performance [debug] => 0 [seqname_format] => %s_seq [autofree] => ) [dbh] => ) [result] => Resource id #11 [row_counter] => [limit_from] => [limit_count] => [limit_type] => alter [autofree] => [fetchmode] => 1 [fetchmode_object_class] => stdClass ) --- <?xml version="1.0"?> <root><result><row><channel_id></channel_id><channel_name></channel_name><channel_type></channel_type><channel_desc></channel_desc><channel_interval></channel_interval><channel_url></channel_url><channel_link></channel_link><channel_img></channel_img><channel_updated></channel_updated></row></result></root> === Array ( [0] => 2 [1] => Top Stories [2] => 1 [3] => [4] => 86400 [5] => http://p.moreover.com/cgi-local/page?index_topstories+rss [6] => [7] => moreover.gif [8] => 0 )

Comments

 [2004-05-31 22:54 UTC] jhughes at chspr dot ubc dot ca
Hi, I had a very similar problem to that described here. In fact, I had two scripts with, to my eyes, exactly the same code, one where $sql2xml->getxml returned the expected result tree, and one where it returned this: <root> <result /> </root> I finally noticed that I was passing two different $options arrays to DB::connect(): one contained 'portability' => DB_PORTABILITY_ALL,', and one didn't. No idea why this is the case, and don't much care as I don't particularly need that option. Hope this helps someone else. James
 [2004-07-11 22:56 UTC] gurugeek
Dear Maintainer, Your package xml_sql2xml has currently 2 open bugs. We urge you to take the necessary steps to solve the reported issues at your soonest convenience. If the bug issue hasn’t been addressed yet you are kindly asked to take the necessary steps to ensure a prompt resolution of the problem. If you already addressed the reported problem feel free to change the bug status as soon as possible. Regards David Costa PEAR Quality Assurance pear-qa@lists.php.net
 [2008-03-23 21:07 UTC] ifeghali (Igor Feghali)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.