How do I change the output of a database query from an integer to a string?
The numeric value from the country is essentially a database lookup value to either a Taxonomy Term, a Countries entry ... or whatever module you're using to reference the location. This is typical DB usage, store keys -- not (text) values of the data. If it was a taxonomy term you could do:

function drupalform_form1_submit($form, $form_state) {

  // Lookup the value for the country id key, somewhere, here I assume Taxonomy.
  $country_term = taxonomy_term_load($form_state['values']['country']);
  $d_id = db_insert('drupalform')
    -&gt;fields(array(
      'name' =&gt; $form_state['values']['name'],
      'last_name' =&gt; $form_state['values']['last_name'],
      'email' =&gt; $form_state['values']['email'],
      // Store the country text value, for Taxonomy Terms thats the name value of the object.
      'country' =&gt; $country_term-&gt;name,
    ))
    -&gt;execute();
   drupal_set_message("Form has been submitted");
}


Assuming your using Taxonomy Terms as countries, and the TID is in only 1 Taxonomy. You would use the same approach with any 3rd party location module.