Hi,
Can someone help me with writing the script to be able to pull the information from the database without refreshing everytime something new has been added?
My codes at the moment read:
$recentupdates = mysql_query("SELECT * FROM status NATURAL JOIN users WHERE user_id = users.id ORDER BY status_id DESC LIMIT 0, 5");
$recentnumrows = mysql_num_rows($recentupdates);
//Creating While Loop to place all information here
while ($recentrow = mysql_fetch_assoc($recentupdates))
{
//Adding the Profile picture
echo '<span style="color:#999999;font-size:8pt;float:right;">'.$recentrow['date'].'</span>';
echo '<span><img style="float:left;padding-right:10px;" src="http://www.youthonfire4christ.com/sitepreview/image.php/'.$recentrow['image'].'?width=50&height=50&cropratio=1:1&image=/sitepreview/upload/'.$recentrow['image'].'"></span>';
echo '<span><strong>'.$recentrow['fname'].' '.$recentrow['lname'].' said: </strong></span><Br />';
echo '<span>'.$recentrow['status'].'</span><br />';
//Line Break between each post.
if ($recentnumrows > 1)
{
echo '<p style="clear:left"></p>';
echo '<p style="border-bottom:#cccccc thin solid;padding-bottom:10px;padding-top:10px;"></p>';
}
}
the codes works of course. But I want it to be updated automatically when a new post has been made.
Thanks!
** I know we need to use AJAX(JQUERY)** But since im new to AJAX and JQUERY i will need alittle assistants on creating the codes**