Please don't mark this as a duplicate since I have already read the following post but still can't understand this issue:
MySQL UPDATE append data into column
I want to append data when users post multiple times. I have a ecommerce site. Now, if the user wants to upload several products for sale, I can't store the information. how would I go about this? should I use UPDATE syntax plus a .= or should I use INSERT plus .= ? I have tried INSERT on my query but it doesn't append anything. and update just replaces the existing data with the new one.
please help me as I like to learn.
here is my code for query:
if(isset($_POST['submit'])) {
$sql = $conn->query("INSERT INTO user(user_id, post_title, post_description) Values('{$user}', '{$productname}', '{$post_desc}')");
$sql .= $conn->query("INSERT INTO user(user_id, post_title, post_description) Values('{$user}', '{$productname}', '{$post_desc}')");
// or should I use the below update query?
$sql .= $conn->query("UPDATE user SET post_title = '{$productname}', post_description = '{$post_desc}' WHERE user_id=$user");
}