From php I am Trying to insert an array using INSERT query. I am getting the error:
Check db Connection Column count doesn't match value count at row 1.
I am new to doing this type of insert and new to using implode. Please Help with some type of solution. My table columns are
IaasForm_id (PK), From_id(FK), roleApp, os, vCPU, Memory, val, Performance, HighWrite, fwconfig, transIn, transOut, bkUp
and sql
$sql = "INSERT INTO FORM(From_id, roleApp, os, vCPU, Memory, val,
Performance, HighWrite, fwconfig, transIn, transOut, bkUp)
VALUES ((SELECT MAX(Form_id) FROM FORM ), '" . implode("','", $array[$i]) . "','" . $hw . "','" . $_POST[ 'fwconfig' ] . "','" . $_POST[ 'transIn' ] . "','" . $_POST[ 'transOut' ] . "','" . $_POST[ 'bkUp' ] . "')";