Why do I get this exception when running a query?
DEFAULT is a reserved MySQL keyword. Try:

db_insert('prod_conf_procuct_parameter')
  -&gt;fields(array(
    'prod_id'=&gt; $arg,
    'price'=&gt; $price,
    'key1' =&gt; $key1,
    'key2' =&gt; $key2,
    '`default`' =&gt; $default
    )
  )
  -&gt;execute();


phpmyadmin does a lot of hand-holding and error squashing for you - it's not advisable to use it as a canonical source of truth for a particular query string's validity.