Using bind for form with lot of inputs (PHP) <p>I have form with lot of inputs, and I'm trying to import them in database (mysql). I want to use bind but trying to avoid writing all variables so many times. Probably I can't explain so good, so I will here is a code</p> <pre><code>if(isset($_POST['firstName']) &amp;&amp; isset($_POST['lastName']) &amp;&amp; isset($_POST['gender'])){ $firstName=trim($_POST['firstName']); $lastName=trim($_POST['lastName']); $gender=trim($_POST['gender']); if(!empty($firstName)&amp;&amp; !empty($lastName)) { $unos = $db-&gt;prepare("INSERT INTO members (firstName,lastName,gender) VALUES (?,?,?)"); $unos-&gt;bind_param('sss', $firstName, $lastName, $gender); if($unos-&gt;execute()) {.... </code></pre> <p>1.Well this is working fine , and it's not a problem, but now I want to add more inputs so I tried this </p> <pre><code>if(isset($_POST['firstName']) &amp;&amp; isset($_POST['lastName']) &amp;&amp; isset($_POST['gender'])){ $firstName=trim($_POST['firstName']); $lastName=trim($_POST['lastName']); $gender=trim($_POST['gender']); $param=array('$firstName','$lastName','$gender'); $type='sss'; $param_list = implode(',', $param); if(!empty($param)) { $unos = $db-&gt;prepare("INSERT INTO members (firstName,lastName,gender) VALUES (?,?,?)"); $unos-&gt;bind_param($type,implode(',', $param)); if($unos-&gt;execute()) {.... </code></pre> <p>and it's not working. I get "Number of elements in type definition string doesn't match number of bind variables"... I don't get it, because when I echo this implode thing I get what I need. I'm pretty newbie with PHP, so help will be so precious. :)</p>