title: Is there anyway to do this faster and with less code? Intermediate
body: <pre><code>class Useradd {
  function insert_user_into_database($user_firstname, $user_lastname, $user_email) {
      $sql = "INSERT INTO user (user_firstname, user_lastname, user_email) 
              VALUES ('$user_firstname', '$user_lastname', '$user_email')";
      $q = mysql_query($sql);
  }
  }
  
  
  
  $user_firstname = mysql_real_escape_string($_POST['firstname']);
  $user_lastname = mysql_real_escape_string($_POST['lastname']);
  $user_email = mysql_real_escape_string($_POST['email']);
  
  
  $useradd = new Useradd;
  $useradd-&gt;insert_user_into_database($user_firstname, $user_lastname, $user_email);
  </code></pre>