|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-03-28 16:27 UTC] f-bischof at versanet dot de
Description: ------------ I use Apache/1.3.31 (Win32) PHP/4.3.10 mod_ssl/2.8.18 OpenSSL/0.9.7d I host a website: http://pocketwelt.dyndns.org If someone writes a forum-article that is longer then 2933 Bytes and i try to save the input (base64_encoded) in my database, and then reload the article, it?s truncated after 2933 bytes. The rest deleted... If i write the article without base64_encoding, i get so much characters in the databse like i want. The Bug seems only appear if i use base64_encoding. (also tested with PHP 5.05 with the same result...) Reproduce code: --------------- $text=base64_encode($text); Text should be about 4 or 5 KB to see the bug ! Expected result: ---------------- Truncated Text afeter 2933 Bytes PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 15:00:01 2025 UTC |
I have made some additionally tests, to write a workaround for this problem !!! Instead of using base64_decode/encode i have replaced all ' with '' in the $text - string to avoid trouble with the sql-insert command. This showed me, that the bug resists, even with not using base64_encode / decode functions. If i insert a big $text - String in the database, the database (MS-Access) stores this Text completely in the Table. But if i select the Text out of the database i got not the complete text like it is in the Database, its truncated after about 3KB. I think the problem is in the mysql_odbc functions. Here a code snipplet: $connect = odbc_connect("astaBB","",""); $query = "SELECT NachrichtsID,User,Datum,TextN,Email from Nachrichten,Login where NachrichtsID=$NachrichtsID and User='$username'"; # perform the query $result = odbc_exec($connect, $query); # fetch the data from the database while(odbc_fetch_row($result)) { $NachrichtsID=odbc_result($result, 1); $User=odbc_result($result, 2); $Datum=odbc_result($result, 3); $Text=odbc_result($result, 4); $email=odbc_result($result, 5); } $Text will be truncated after about 3KB, but the Table-Field TextN (Access-Memo Field) has the complete 4KB Text stored.