Passing array values from php to javascript data returns only one value
<p>This function works fine, but it only returns one value. What I'm missing here?</p>

<p>Here's my code:</p>

<pre><code>  &lt;script type='text/javascript'&gt;
$(function () {

&lt;?php
//Get the names and id's
$get_info=mysql_query("select * from table where id = '1'");

if($get_info){
while($row_info=mysql_fetch_array($get_info))
{
$username=$row_info['name'];
$user_id=$row_info['profile_id'];
?&gt;


onDataRequest:function (mode, query, callback) {
 var data = [

{ id:&lt;?php echo $user_id;?&gt;, name:'&lt;?php echo $username;?&gt;', 'avatar':'http://cdn0.4dots.com/i/customavatars/avatar7112_1.gif', 'type':'contact' }

 ];

     data = _.filter(data, function(item) { return item.name.toLowerCase().indexOf(query.toLowerCase()) &gt; -1 });
     callback.call(this, data);
    }
  });

&lt;?php
}}
?&gt;
});
&lt;/script&gt;
</code></pre>

<p><strong>Expected result:</strong></p>

<pre><code>{
    id: 295,
    name: 'Mike',
    'avatar': 'http: //cdn0.4dots.com/i/customavatars/avatar7112_1.gif',
    'type': 'contact'
},
{
    id: 296,
    name: 'John',
    'avatar': 'http: //cdn0.4dots.com/i/customavatars/avatar7112_1.gif',
    'type': 'contact'
}
</code></pre>

<p><strong>Actual output:</strong></p>

<pre><code>{
    id: 295,
    name: 'Mike',
    'avatar': 'http: //cdn0.4dots.com/i/customavatars/avatar7112_1.gif',
    'type': 'contact'
}
</code></pre>

<p>It just returns 1 item.</p>
