workout with the php returned array to jquery
<p>my this php code is working for the $.ajax call which is below this code</p>

<pre><code>    $family = mysql_real_escape_string($_REQUEST['send_txt'], $link);
$query = "SELECT imgurl FROM images WHERE family='$family'";

//Query database
$result = mysql_query($query, $link);

//Output result, send back to ajax as var 'response'

$imgurl=array();
//$i=0;
if(mysql_num_rows($result) &gt; 0){
    //Fetch rows
    while($row = mysql_fetch_array($result)){

        $imgurl[]=$row['imgurl'];

        }
}
echo $imgurl; 
</code></pre>

<p>jquery code</p>

<pre><code>$(document).ready(function() {
$('ul.sub_menu a').click(function() {
    var txt = $(this).text();
        $.ajax({
         type: "POST",
        url: "thegamer.php",
        data:{send_txt: txt},
        success: function(data){
        $('#main-content').html(data);
        }   
        });
    });
}); 
</code></pre>

<p>it outputs just Array written at the #main-content div how to work with that array which are basically image paths</p>
