Populating value of an array
<p>I have a function </p>

<pre><code>public function get_detail($subscriberid)
    {
    $bigArray = array();

    $result = mysql_query("SELECT *  from prospect_requests WHERE subscriber_id = '$subscriberid'");
    //$user_data = mysql_fetch_array($result);
    $no_rows = mysql_num_rows($result);

    while( $row = mysql_fetch_assoc( $result))
    {

$bigArray[] = $row;
    }
     return json_encode($bigArray);

    }
</code></pre>

<p>i am calling this function by using the user class object from my html and it is returning the data in form array </p>

<p>I am tring to populate those value in my html table do i am using the following method  </p>

<pre><code>&lt;table&gt;
 &lt;?php
 $ary = json_decode($user-&gt;get_detail($uid));
         echo "&lt;tr&gt;"         
         foreach($ary as $key=&gt;$value) {
              echo "&lt;td&gt;";
              print  $key['$value'];
              echo "&lt;/td&gt;";
           }
   echo "&lt;/tr&gt;";

  ?&gt;
</code></pre>

<p>the above foreach is not printing for me </p>

<p>But when i am printing the <code>print_r($ary);</code>
I am getting the desire array of arrays .</p>

<p>Please tell me why  values are not populating in table.</p>

<p><strong>Update output of print_r($ary)</strong></p>

<pre><code>Array ( [0] =&gt; stdClass Object ( [id] =&gt; 133 [customer_id] =&gt; caason [subscriber_id] =&gt; ELECTRO_SUBS_12800 [extension_id] =&gt; [vendor_number] =&gt; [product_code] =&gt; [prospect_email1] =&gt; naveen.ggg@bhng.com [prospect_phone1] =&gt; +575445 [prospect_email2] =&gt; [prospect_phone2] =&gt; [prospect_title] =&gt; IT Engineer [prospect_company] =&gt; gggg [prospect_name] =&gt; ggdf [prospect_message] =&gt; MESSAGE [create_timestamp] =&gt; 2012-12-20 16:28:46 [update_timestamp] =&gt; 2012-12-20 16:33:15 [status] =&gt; 0 [track_id] =&gt; 201660a2-4a66-11e2-abeb-00151771ff65 [initiated_by] =&gt; SMS [subscriber_email] =&gt; g.dgdg@gfg.com [vendor_email] =&gt; ananda.rao@talismanuc.com ) [1] =&gt; stdClass Object ( [id] =&gt; 134 [customer_id] =&gt; caason [subscriber_id] =&gt; ELECTRO_SUBS_12800 [extension_id] =&gt; [vendor_number] =&gt; [product_code] =&gt; 12800 [prospect_email1] =&gt; gpadaki@sadhanasystems.com [prospect_phone1] =&gt; +756767863 [prospect_email2] =&gt; [prospect_phone2] =&gt; [prospect_title] =&gt; TESTING232 [prospect_company] =&gt; Sadhana Systems [prospect_name] =&gt; 7dfgfg [prospect_message] =&gt; MESSAGE [create_timestamp] =&gt; 2012-12-22 02:43:51 [update_timestamp] =&gt; 2012-12-22 22:42:36 [status] =&gt; 0 [track_id] =&gt; 380024bc-4b85-11e2-abeb-00151771ff65 [initiated_by] =&gt; SMS [subscriber_email] =&gt; naveen.fgf@ggf.com [vendor_email] =&gt; g.f@talismanuc.com ) [2] =&gt; stdClass Object ( [id] =&gt; 135 [customer_id] =&gt; caason [subscriber_id] =&gt; ELECTRO_SUBS_12800 [extension_id] =&gt; [vendor_number] =&gt; [product_code] =&gt; 12800 [prospect_email1] =&gt; naveen.vghg@hgh.com [prospect_phone1] =&gt; +25454 [prospect_email2] =&gt; [prospect_phone2] =&gt; [prospect_title] =&gt; Sw Engineer [prospect_company] =&gt; Talisman [prospect_name] =&gt; Naveen [prospect_message] =&gt; MESSAGE [create_timestamp] =&gt; 2013-01-02 16:32:38 [update_timestamp] =&gt; 2013-01-02 16:35:48 [status] =&gt; 0 [track_id] =&gt; d1da0adc-549d-11e2-abeb-00151771ff65 [initiated_by] =&gt; SMS [subscriber_email] =&gt; naveen.ggjg@hgjh.com [vendor_email] =&gt; gf.fhg@hgh.com ).......))
</code></pre>
