MYSQL Insert doesn't insert anything

  command = topicArr;

  // get sub-subtopic: channel number
  topicArr = strtok( NULL, "/");
  channelNo = atoi(topicArr);

You change where topicArr points. That changes where command points. Probably NOT what you want to do.