fetching records from webform_submitted_data table through following source code but showing error
Try below code,

You can retrieve node webform all submissions using  webform_get_submissions which accepts an array of filters.. As per the error you mentioned in the question seems like below code is causing problem

echo $val = $submission-&gt;data[15][0];


I would suggest printing the information that you got before you try to fetch the data so that you know you are correclty accessing the array results.. print_r will assist you to see the results..

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

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;';
    }
}


Extract the information you want from $row and $data ...