title: Proper way to insert data into table with php and mysql?
body: <p>I am trying to insert data into table from a form submission. I've already insured that there is connection  with the database. I would like to know if I am doing this properly. Here is my code.</p>
  
  <pre><code>   //INSERT INTO TABLE
     $name  = trim($_POST['name']); 
     $bio   = trim($_POST['bio']); 
     $email = trim($_POST['email']); 
  
        if(isset($name, $bio, $email)) {
            if($db-&gt;query("
              INSERT INTO users(name, bio,email, created,updated)
              VALUES ('{$name}', '{$bio}','{$email}', NOW())")) {
              echo 'number of rows effected by the INSERT:', $db-&gt;affected_rows; 
  
             }
  
         }
  </code></pre>
  
  <p>Please keep in mind,  I am just new PHP, thanks for your help. </p>