|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-10-05 22:02 UTC] rasmus@php.net
[2001-10-09 10:12 UTC] erik at totalcirculation dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 23:00:01 2025 UTC |
<pre> The summary says it all, I guess. $indexed = array(); $assoc = array(); $nullassoc = array(); while($row = ibase_fetch_row($sth)) { array_push($indexed, $row[0]); $assoc[$row[0]] = $row[1]; $nullassoc["${row[0]}\0"] = $row[1]; } foreach($indexed as $key=>$val) { echo "indexed key: '$key' val: '$val'<br>\n"; } foreach($assoc as $key=>$val) { echo "assoc key: '$key' val: '$val'<br>\n"; } foreach($nullassoc as $key=>$val) { echo "nullassoc key: '$key' val: '$val'<br>\n"; } If you run this code with a select statement such as select varcharcol, varcharcol2 from table, you should see the problem. You may need to run it a couple times to actually see it happen. The problem could also be in the routine that handles $array[$key] = $val, as evidenced by the first runthrough, where the values appear to be correctly null terminated. Feel free to contact me with any questions or if this doesn't make sense! Thanks </pre>