title: How to append data in a mysql database using php
body: <p>Please don't mark this as a duplicate since I have already read the following post but still can't understand this issue:</p>
  
  <p><a href="https://stackoverflow.com/questions/14020867/mysql-update-append-data-into-column">MySQL UPDATE append data into column</a></p>
  
  <p>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. </p>
  
  <p>please help me as I like to learn. </p>
  
  <p>here is my code for query:</p>
  
  <pre><code>if(isset($_POST['submit'])) {
   $sql = $conn-&gt;query("INSERT INTO user(user_id, post_title, post_description) Values('{$user}', '{$productname}', '{$post_desc}')");     
   $sql .= $conn-&gt;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-&gt;query("UPDATE user SET post_title = '{$productname}', post_description = '{$post_desc}' WHERE user_id=$user");
  </code></pre>
  
  <p>}</p>