title: Can't parse this JSON in php
body: <p>I'm trying to get off some mails from Yahoo Query Language using OAuth, everything is fine and alright, except, YQL returns JSON, and somehow I'm not able to parse it!</p>
  
  <p>I'm able to parse simple JSONs like</p>
  
  <pre><code>'{"hello":"world"}'
  </code></pre>
  
  <p>but not this one:</p>
  
  <pre><code>{
  "query": {
      "count": 1,
      "created": "2012-08-11T19:22:51Z",
      "lang": "en-US",
      "results": {
          "result": {
              "messageInfo": [
                  {
                      "from": {
                          "name": "account-services-us@cc.yahoo-inc.com"
                      },
                      "subject": "Success! You have shared your Yahoo! information"
                  },
                  {
                      "from": {
                          "name": "account-services-in@cc.yahoo-inc.com"
                      },
                      "subject": "Success! You have shared your Yahoo! information."
                  },
                  {
                      "from": {
                          "name": "account-services-in@cc.yahoo-inc.com"
                      },
                      "subject": "Success! You have shared your Yahoo! information."
                  },
                  {
                      "from": {
                          "name": "Yahoo!"
                      },
                      "subject": "Welcome to Yahoo!"
                  }
              ]
          }
      }
  }
  }
  </code></pre>
  
  <p>I tried validating it in 
      <a href="http://jsonlint.com/" rel="nofollow">http://jsonlint.com/</a></p>
  
  <p>and it's valid!</p>
  
  <p>Edit: I need to display 'from:name' and 'subject' in a table like structure.</p>
  
  <p>The code snippet I wrote is this:</p>
  
  <pre><code>$sdata = call_yql(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET,
                 $access_token, $access_token_secret,
                 false, true);
  $json_data = json_encode($sdata);
  $mails = json_decode($json_data);
  print_r($mails-&gt;query);
  </code></pre>
  
  <p>The Error i get is:</p>
  
  <pre><code>Notice: Trying to get property of non-object in C:\xampp\htdocs\yahoo\txtweb\yql.php       on line 21
  </code></pre>