|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-05-30 11:34 UTC] opendev at us dot ibm dot com
[2007-05-30 12:28 UTC] matthewv at ca dot ibm dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 01:00:01 2025 UTC |
Description: ------------ This piece of code is being run against the sample XML database created with ?db2sampl ?xml?. Clean output is produced on windows and garbage is produce when I run this sample on various Linux systems. Reproduce code: --------------- <?php $db2conn = db2_connect("SAMPLE", "", ""); $query = "SELECT cid AS CID, XMLSERIALIZE(info as blob) as INFO FROM customer WHERE cid < 1005"; $stmt = db2_exec($db2conn, $query); if($stmt === false) { print(db2_stmt_errormsg() . "\n"); } else { print($toPrintToScreen); // retrieve and display the result from the xquery $aResult = db2_fetch_assoc($stmt); printf("%s\n%s\n\n", $aResult['CID'], $aResult['INFO']); db2_free_stmt($stmt); } ?> Expected result: ---------------- 1000 <customerinfo xmlns="http://posample.org" Cid="1000"><name>Kathy Smith</name><addr country="Canada"><street>5 Rosewood</street><city>Toronto</city><prov-state>Ontario</prov-state><pcode-zip>M6W 1E6</pcode-zip></addr><phone type="work">416-555-1358</phone></customerinfo> Actual result: -------------- 1000 EuȜ ?i?i Hi aResult " Ci 5 ?iF miQ