After insert data to table, updating data in home page drupal7 I have a insert_data module that used to insert data to category table, and I also have a module named mysite that has a function named “function mysite_preprocess_panels_pane(&amp;$variables) “  is used to render data to panel.tbl.php.

My question is how can I call function “mysite_preprocess_panels_pane(&amp;$variables)” from mysite module.  

My purpose is after inserting data to table I want to show update data in home page(panel.tbl.php). I am new to drupal I need help or suggestion.
Thanks

Insert_data module

function insert_data($fn,$data) {
    $reply='';
    $status =1;
    $cid = db_insert('category') // Table name no longer needs {}
    -&gt;fields(array(   
   'name' =&gt; $data['name'],
   ))-&gt;execute();

   module_load_include('module', 'mysite', 'mysite');
   function mysite_preprocess_panels_pane();
   $reply= (array('status' =&gt; $status,'category' =&gt; $cid) );
   return $reply;
}


Calling mysite_preprocess_panels_pane() without parameter will be fine?

Mysite module

function mysite_preprocess_panels_pane(&amp;$variables) {
    $query = db_select('category', 'n');
    $query-&gt;fields('n');
    $items = $query-&gt;execute()-&gt;fetchAll();

    $variables['ar'] = $items;
}


Panel.tbl.php

&lt;div class="panel-panel panel-col-first"&gt;a 
    &lt;?php 
        if (isset($variables['ar'])) {
             foreach (array_keys($variables['ar']) as $name) {
             print render($ar[$name]);
        }
     }

?&gt;&lt;/div&gt;
Instead of implementing template_preprocess_panels_pane() and inserting your content there is something called ctools content types.

A ctools content type shows up in the panels interface as panes that can be added to a region.

In your case I would create a ctools content type in your module mysite. 

Basically it's a block that contains rendered data that can be placed in a region of your choice.

It will be more easy to understand for other developers how the data is inserted on the front page also since it will be visible in the Panels interface.

/**
 * Implements of hook_ctools_plugin_directory().
 */
function MYMODULE_ctools_plugin_directory($module, $plugin){
  if ($module == 'ctools' || $module == 'panels'){
    return 'plugins/' . $plugin;
  }
}


Then create a folder in your module called plugins and in that folder create a folder called plugins. Place a file called MYPLUGIN.inc
The file should then be placed in mymodule/plugins/content_types/MYPLUGIN.inc

Place this content in your MYPLUGIN.inc

&lt;?php

$plugin = array(
  'single' =&gt; TRUE,
  'title' =&gt; t('MYPLUGIN'),
  'render callback' =&gt; 'MYPLUGIN_content_type_render',
  'description' =&gt; t('Renders something.'),
  'category' =&gt; t('Custom'),
  'edit form' =&gt; 'MYPLUGIN_content_type_edit_form',
);

/**
 * Render the custom content type.
 */
function MYPLUGIN_content_type_render($subtype, $conf, $panel_args, $context) {
  $block = new stdClass();
  $block-&gt;content = 'MYDATA';
  return $block;
}

/**
 * Edit callback.
 */
function MYPLUGIN_content_type_edit_form($form, &amp;$form_state) {
  $conf = $form_state['conf'];
  return $form;
}

/**
 * Implements hook_form_submit().
 */
function MYPLUGIN_content_type_edit_form_submit($form, &amp;$form_state) {
  foreach (element_children($form) as $key) {
    if (!empty($form_state['values'][$key])) {
      $form_state['conf'][$key] = $form_state['values'][$key];
    }
  }
}


Now replace $block->content with the data you want to be rendered.