php - How to allocate? -
$capture_field_vals =""; foreach($_post["mytext"] $key => $text_field) { $capture_field_vals .= $text_field .", "; } $insert = "insert tabel1(numbers) values('$capture_field_vals')";
in database (5342324, 23432423, 24234242, 234234234)
and want do..
$insert2 = "insert tabel2(number1, number2, number3, number4) values('$capture_field_vals[0]','$capture_field_vals[1]','$capture_field_vals[2]','$capture_field_vals[3]')";
$capture_field_vals=array(); foreach($_post["mytext"] $key => $text_field){ array_push($capture_field_vals,$text_field); }
then
$insert2 = "insert tabel2(number1, number2, number3, number4) values('$capture_field_vals[0]','$capture_field_vals[1]','$capture_field_vals[2]','$capture_field_vals[3]')";
Comments
Post a Comment