Re: loops and arrays

From: Date: Fri, 08 Sep 2000 08:59:12 +0000
Subject: Re: loops and arrays
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-15844@lists.php.net to get a copy of this message
Kevin, // create the files sent date $FSD .= "$Year"."$Month"."$Day"; // The $FSN is the file sequence number from created in the Header_Submit function Should be: $FSD = "$Year"."$Month"."$Day"; Exchange the ".=" with just a "=" If you change: echo $queryStatus; to echo "|" .$queryStatus ."|<br>\n"; you might spot which part is repeating. It could be that the select statment is returning the extra records. Take a look at all the returned data or run the select inside mysql. hth, David. ----- Original Message ----- From: <kevin@oceania.net> To: <php-general@lists.php.net> Sent: Thursday, September 07, 2000 7:17 PM Subject: [PHP] loops and arrays > > I have a function that has a while loop that returns an > array and from that array I do several things. One of > them is to INSERT into a table. the $queryStatus seems > work ok but does several odd things > Firstly it adds Three extra records to the table with > some of the variables missing? > Secondly, when executed it appends the variable $SPRecordSequence > to itself on each loop so that the end result is like below > where I have echoed the query > > INSERT INTO Status (RecordType, SPRecordSequence, WNOFileSentDate, > WNOFileSentSequenceNumber) VALUES > ('10','000000109','20000908','0005') > INSERT INTO Status(RecordType, SPRecordSequence, WNOFileSentDate, > WNOFileSentSequenceNumber) > VALUES('10','000000110','2000090820000908','0005') > INSERT INTO Status (RecordType, > SPRecordSequence,WNOFileSentDate,WNOFileSentSequenceNumber)VALUES('10','0000 00111','200009082000090820000908','0005') > INSERT INTO Status (RecordType,SPRecordSequence, > WNOFileSentDate,WNOFileSentSequenceNumber)VALUES('10','000000112','200009082 00009082000090820000908','0005') > INSERT INTO Status (RecordType,SPRecordSequence, > WNOFileSentDate,WNOFileSentSequenceNumber)VALUES('10','000000113','200009082 0000908200009082000090820000908','0005') > > As you can see the variable is waaay out of shape bye the fifth time > the function is at http://www.oceania.net/kevin/Transfer.phps > > All replies gratefullly recieved > > > Kevin > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#15844) next »