problems with php 4.1.1 (strtok?)
| From: | Robert Mena | Date: | Fri, 04 Jan 2002 15:31:02 +0000 |
| Subject: | problems with php 4.1.1 (strtok?) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-79461@lists.php.net to get a copy of this message | ||
Hi,
I have a script to upload/insert records in a mysql
db. I was running fine before the upgrade (php
4.0.4pl1) now it confuses the columns starting with
the column number 9.
I've attached a one line file that I used with the
scripts. the problem seems to be with strok and null
values. One of the columns is empty so I have
value1\t\tvalue2 and it seems to confuse itself.
The script that parses the line is like this
$C_F=strtok($line,"\t");
$dt=strtok("\t");
$DT=strtok("\t");
Using the same script under php4.0.6 with the same
upload file it shows (correct) :
insert into table values
values('05','01/11/01','10:01','MYCOMPANY','04.679.080/0001-04','OTHERCOMPANY','SP-SAO
PAULO','47.427.653/0014-30','109726','02','091330','15','VOL','PROD','383,1000','10075/01','EQT-0001','EQT-0001','','','','','','','','','01/11/01','08:00','01/11/01','18:00','09/11/01','08:00','09/11/01','08:00','','7D,22H','')
Using the same script under php4.1.1 with the same
upload file it shows (incorrect 02 at column number 9)
:
insert into cargas values
values('05','01/11/01','10:01','MYCOMPANY','04.679.080/0001-04','OTHERCOMPANY','SP-SAO
PAULO','47.427.653/0014-30','02','091330','15','VOL','PROD','383,1000','10075/01','EQT-0001','EQT-0001','01/11/01','08:00','01/11/01','18:00','09/11/01','08:00','09/11/01','08:00','7D,22H','050210972604.679.080/0001-0447.427.653/0014-30091330','/
/','','','','','','','','','109726')
Thanks.
__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com