|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-04-23 04:31 UTC] lawe at tdk dot dk
[2001-05-03 03:32 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 07:00:01 2025 UTC |
// f1 and f2 are of type varchar $id=ibase_query($tr_id, "SELECT f1, f2 FROM t1;"); $res = ibase_fetch_row($id); echo "'".$res[0]."'"; // Working fine $arr[$res[0]] = 1; $arr[$res[1]] = 2; foreach ($res as $r => $v) echo "'$r'\n"; // will in some cases add unexpected // characters to end of $r // It is the same with each construct // The same applies to ibase_fetch_object() The values in the database are correct, as the unwanted characters may vary depending on the number of columns in the select-statement. But it is always the same characters on repeated executions. I have made a work-around in a way like this: $arr[str_pad($res[0], -1)] = 1; I think it has something to do with the Interbase-API, as it is the same errors regardless of the Webserver (Apache 1.3.14 & 1.3.19, PHP 4.0.4pl1 or Win9x PWS, CGI or ISAPI version of PHP 4.0.4pl1) connecting to Interbase 6.01 on RedHat 6.1 and RedHat 6.2 The bug was first observed when doing a split(), where the last element in the resulting array had strange characters attached to the end. PHP configured with minimal changes to defaults (Interbase support, enable-track-vars). Hope this is sufficient information, otherwise write me for further info, and I will try to deliver it (if I can). Regards /Lars