Hi,
I know how to add multiple records via MySQL using
INSERT INTO table (column1, column2)
VALUES ('value1', 'option1'),
('value2', 'option2'),
('value3', 'option3')
But how do you do this via php? I need to add 3 values as 3 separate records.
Could you use..
$sql = "INSERT INTO table (user_id,value,option)
VALUES ('$user_id','$value1','$option1')
('$user_id','$value2','$option2')
('$user_id','$value3','$option3')";
I know how to add multiple records via MySQL using
INSERT INTO table (column1, column2)
VALUES ('value1', 'option1'),
('value2', 'option2'),
('value3', 'option3')
But how do you do this via php? I need to add 3 values as 3 separate records.
Could you use..
$sql = "INSERT INTO table (user_id,value,option)
VALUES ('$user_id','$value1','$option1')
('$user_id','$value2','$option2')
('$user_id','$value3','$option3')";