Webform show result table on webform node tpl I am trying to display results of a certain content type (webform: event)

So my idea is that i would embed the table into the the tpl (node--event.tpl.php)
I tried many different ways and the closest i can get is the following code

module_load_include('inc','webform','includes/webform.submissions');
$submissions = webform_get_submissions(array('nid'=&gt; 4));

foreach ($submissions as $submission){
    foreach ($submission-&gt;data as $row=&gt;$data){
        print '&lt;pre&gt;';print_r($row);print '&lt;/pre&gt;';
        print '&lt;pre&gt;';print_r($data);print '&lt;/pre&gt;';
    }
}


This works but just for a single node, in this case node 4, I would like to show this of the current node.
Try the Webform Report module, it looks perfect for what you need.

Or, Why not use views?

It would be easier to use webform 7.x-4.0-rc3 and create a view table for webform submission data. You can easily grab the separate values and arrange them into a table.

You also have the ability to create a reference so only the results from node 4 are being shown.

EDIT:
use $node->nid; , so...

$nid = $node-&gt;nid;

module_load_include('inc','webform','includes/webform.submissions');
$submissions = webform_get_submissions(array('nid'=&gt; $nid));

foreach ($submissions as $submission){
    foreach ($submission-&gt;data as $row=&gt;$data){
        print '&lt;pre&gt;';print_r($row);print '&lt;/pre&gt;';
        print '&lt;pre&gt;';print_r($data);print '&lt;/pre&gt;';
    }
}