Get a message if insert into table works The code I wrote that uses db_insert() and db_merge() works great. I can populate the database table well (also using a post http). Now I want to get a success/fail message.

How do I show a message after executing a query?
You can use drupal_set_message() to display a message in the browser, this can be marked as a status', 'warning' or 'error' message.

If you want to debug your code, the Devel module is recommended and provides the dpm() function. Besides being able to print a simple message, dpm() also allows to display an array or object quite easy.