 <p>Try re-writing your query to:</p> <pre><code>$name = trim($form_state['values']['name']); $formwem = $form_state['values']['settings']['active']; $result = db_query("INSERT INTO twittername (name, Blogurt, Twitter_name) VALUES (':name',':blogurt',':twitter_name')", array(':name' =&gt; $name, ':blogurt' =&gt; $formwem, ':twitter_name' =&gt; $formwem)); </code></pre> <p>Though I'm not sure which form field populates the two columns <code>Blogurt</code> and <code>Twitter_name</code>. Can you please explain?</p>