list of all participations for a contact
Ouch - you're doing it the hard way!

Getting a list of participant records by contact ID is pretty simple using the API.  It sounds like maybe you haven't discovered the API Explorer.  Without knowing your Civi version (and CMS software/version) I can't tell you exactly where to find it.  If you're on Civi 4.5 or 4.6, then in the Help menu (renamed to Support menu in 4.6.5+), go to Developer > API Explorer.  If you're on an earlier version, in Drupal it's example.org/civicrm/api/explorer - I can't speak to other CMSes.

Below I've copy/pasted my API Explorer results for finding all the participant records for contact ID 247.  Note that some of the syntax for Javascript may not work in Civi earlier than 4.6, so run API Explorer yourself to double-check!

Rest    

/sites/all/modules/civicrm/extern/rest.php?entity=Participant&amp;action=get&amp;api_key=yourkey&amp;key=sitekey&amp;json={"sequential":1,"contact_id":247}


Smarty  

{crmAPI var='result' entity='Participant' action='get' contact_id=247}
{foreach from=$result.values item=participant}
  {$participant.some_field}
{/foreach}


Php 

$result = civicrm_api3('Participant', 'get', array(
  'sequential' =&gt; 1,
  'contact_id' =&gt; 247,
));


Javascript  

CRM.api3('Participant', 'get', {
  "sequential": 1,
  "contact_id": 247
}).done(function(result) {
  // do something
});