Hi,

I just tried
Code:
insert into test1 (nam) values ('John'), ('Mark'), ('Mary');
I guess it would not like an extra comma after the last set of values, so you should probable code
Code:
for($i = 0 ; $i < .... ; $i++)
{   if($i) $allvalues .= ',';
    $allvalues .= ....
}
You have some $paymentAmount[i] around, this should be $paymentAmount[$i]

Musicman