I was following the examples given here on this thread
Why is insert not working and not outputting any error on postresql?
While I am trying to insert multiple values using this option inside the data base; I encountered this error "ERROR: syntax error at or near "Array" LINE 2: VALUES Array.." Could any assist please? Below is the code:
…….
"INSERT INTO people( mom, non, ooo)
VALUES
($1, $2, $3),
($4, $5, $6),
($7, $8, $9),
($10, $11, $12)
ON CONFLICT (mom) DO NOTHING";
$rcon = pg_query_params($connection, $ins,
Array(
[ $mom ,$non, $kooo],
[ $mom 1,$non1, $kooo1],
[ $mom 2,$non2, $kooo2],
[ $mom 3,$non3, $kooo3]
)
);
if(!$rcon){
echo pg_last_error($connection);
}else{
echo "Record added to database</br>"; //success confirmation
}
This gives this error; ERROR: bind message supplies 4 parameters, but prepared statement "" requires 12