jquery refresh php loop?
<p>I have a page in which users can make "posts" its similar to facebook, I am trying to figure out how I can get it to run the php loop say every 10mins, in order for the person to see new posts. Everytime a post is made it is added into the db and then the page is refreshed, I want to do it more "facebook like". Using jquery slide down etc. Below is what I have up2 now.</p>

<pre><code>function postdata()
{
    $.ajax({
    type: "POST",
    dataType: "text",
    url: "makepost.php",
    data: "post_text=" + $("#post_text").val(),
    cache: false,
    success: function(reply_text)
    {
        if (reply_text.indexOf("Successful") &gt;= 0)
        {
            alert("Post Made");
            window.location = "index.php"


        }
        else 
        {
            alert(reply_text);
        }
    }
    });
}

&lt;/script&gt;

    &lt;div id="content"&gt;
&lt;?php

if (loggedin())
{

$ID = getID();
$query = "SELECT * FROM `posts`";
$result=mysql_query($query);
$count=mysql_num_rows($result);

$users = "SELECT `userID` FROM `users`";
$resultID=mysql_query($users);


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

echo '&lt;div class="posts"&gt;';

    echo $row['2']."&lt;br /&gt;&lt;br /&gt;";      

        echo '&lt;div class="posts_bottom"&gt;';

            echo '&lt;p class="name"&gt;';

            echo showuser($row['1'])."&lt;/p&gt;";

            echo '&lt;p class="rate"&gt;';

            echo '&lt;input type="submit" value="+1"/&gt;&lt;/p&gt;';   

            echo '&lt;p class="points"&gt;';

            echo showpoints($row['1'])."&lt;/p&gt;";

        echo "&lt;/div&gt;";

echo '&lt;/div&gt;';

}
echo 
'&lt;div id="makepost"&gt;
    &lt;br /&gt;&lt;textarea rows="3" cols="25" id="post_text" &gt;&lt;/textarea&gt;&lt;br /&gt;
    &lt;input type="submit"  id="post_bttn" value="Post" onclick="postdata(); return false;"&gt;  
&lt;/div&gt;';
</code></pre>

<p>As they are put into a new div everytime I don't know what to refresh? Such as if it was one div I could jus refresh that, but these are being created and I don't know how many would need to be loaded.</p>

<p>Any adivce? Thanks alot :D</p>
