Hello and Thanks in advance!
I have a loop that inserts multiple comments into my database. Problem being, I cannot concatenate my variable in my insert script that resides in my while loop.
Reason for multiple comment boxes in I can only display 79 characters on a green screen.
here is my code
$NVNDR = $_POST[Vendor];
$NITEM = $_POST[Item];
$NITEM2 = $_POST[Item]; //protect against END OF FILE interuption
$COMT1 = $_POST[Comments1];
$COMT2 = $_POST[Comments2];
$COMT3 = $_POST[Comments3];
$COMT4 = $_POST[Comments4];
echo $COMT1;
echo $COMT2;
echo $COMT3;
echo $COMT4;
// create loop to insert multiple comments
$COMCOUNT = 1;
while($COMCOUNT < 5){
$sqlINSERT = "INSERT INTO FILES.NICOMMT(NTVNDR, NTITEM, NTSEQ, NTCOMT)
VALUES('$NVNDR', '$NITEM2', '$COMCOUNT', '$COMT"."$COMCOUNT')"; //<MY PROBLEM
$stmt = db2_prepare($i5XX2, $sqlINSERT)
or die("Prepare error: " . db2_stmt_errormsg());
$result = db2_exec($i5XX2, $sqlINSERT)
or die("Execute error: " . db2_stmt_errormsg());
$COMCOUNT++;
}
I can get it to insert 1-4 so I know my count is work - I Just cannot appead that count to the end of my $COMT variable so it inserts the 4 comment variables???
This is probably an easy solution but I am having troubles.
Thanks Again,
j