db_query gives PDO Exception "General error: 1366 Incorrect integer value:" when I try to update table
From the Drupal API on db_query:


  Do not use this function for INSERT, UPDATE, or DELETE queries. Those should be handled via db_insert(), db_update() and db_delete() respectively.


The recommended method:

// Insert values returned from Twitter API.
$tweetsdb_id = db_insert('tweetsDB')
-&gt;fields(array(
  'handle' =&gt; $handle,
  'tweet' =&gt; $tweet,
  'time_string' =&gt;$time_string,
  'tweetid' =&gt; $id,
))
-&gt;execute();