|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-15 00:56 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 16:00:02 2025 UTC |
Description: ------------ I have a payed site from www.netfirms.com they use 4.3.6 if understand that problem is because of earlier version and solved in newer ones, i will tell them to upgrade it. Nobody could be able understand this they told me that this may be a bug so i submitted here. Problem is: I upload a .txt file and access inside and take contents. Up to here it is ok but by then i cannot insert this content to mysql table as a new row or updated row. It reads the content and stores in $buffer variable but when it tries to insert into table it can not, besides if i try to insert that content by opening by notepad and manually copy-paste into a textarea it achieves to insert this way. The content is some long like 3-5kbs file size. I set the coloumn type in mysql to longtext but not solved. I don't know the problem is because of me or the system. When i delete the long rows from file it achieves but i can not delete them. Reproduce code: --------------- $actt=@copy($file, "$absolute_path/file.txt") or die("No upload.. $geri");$dosyam="../beyazesya/Del/file.txt";$fp=fopen($dosyam,"r") or die("Cant open the file");while(!feof($fp)){$buf = fgets($fp,8192);$buffer=$buffer.$buf;}$buffer=eregi_replace("t","",$buffer);$buffer=trim($buffer);$f_a=$file_name;$model=str_replace(".txt","",$f_a);$resim="$model.$tur";mysql_connect("xxx","yyy","zzz");mysql_select_db("aaa");$bb=mysql_query("SELECT * FROM beyaz WHERE alan1='$alan1' AND alan2='$alan2' AND alan3='$alan3' AND model='$model'");$say_bb=mysql_num_rows($bb);if($say_bb<1){$b=mysql_query("INSERT INTO beyaz (alan1,alan2,alan3,resim,model,html) VALUES ('$alan1','$alan2','$alan3','$resim','$model','$buffer')") or die("Could not insert the row"); Expected result: ---------------- If it can insert that long .txt file's content by textarea it must also insert by opening a file reading inside. Actual result: -------------- It cannot insert the .txt file's content to mysql table.