title: How to save data in same row?
body: <p>Hi how I can save data in same row in database I'm saving to database using this code but it's saving in different two rows please help me thanks. here is screenshot of database.
  <a href="https://i.stack.imgur.com/rSqN4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rSqN4.png" alt="Screenshot"></a></p>
  
  <pre><code>&lt;?php
  
      $users = array("username"=&gt;"Kaleem", "address"=&gt;"abc");
  
  class dbase{
  
      public function dbinsert($table,$users)
      {
          foreach ($users as $key =&gt; $value) 
          {
              $sql = "INSERT INTO $table (`$key`) VALUES ('$value')";
              $success = $this-&gt;conn-&gt;query($sql);
              if($success)
              {
                  echo "Data inserted";
              }
          }
      }
  
  
          public function __construct ()
          {
  
              $this-&gt;conn = new mysqli('localhost','root','','dbase');
  
              if($this-&gt;conn)
              {
                  echo "Connected&lt;br&gt;";
              }
          }
  
  
  }
  
  $obj = new dbase;
  $obj-&gt;dbinsert('users',$users);
  
  </code></pre>