Sorry if this is a duplicate, but I can't reached the result using answers in similar questions.
Here is my situation:
I have a table (users_temp
) with 1 column - Users_id
;
And I have an array of values, for example - $usersIds = [1,2,3,4,5]
;
I want to Insert this array to my table and create 5 new rows. I was trying smth like that, but it doesn't work:
$newdata = "'" . implode("','", $usersIds) . "'";
db_query("INSERT INTO db.users_temp (user_id) VALUES ($newdata)");
Can you help me, please?