From:             joshqune at yahoo dot com
Operating system: FreeBSD
PHP version:      4.3.8
PHP Bug Type:     MySQL related
Bug description:  Inserting a new row problem

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:
---------------
[EMAIL PROTECTED]($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.

-- 
Edit bug report at http://bugs.php.net/?id=31093&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31093&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31093&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31093&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31093&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31093&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31093&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31093&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31093&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31093&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31093&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31093&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31093&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31093&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31093&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31093&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31093&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31093&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31093&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31093&r=mysqlcfg

Reply via email to