im trying to get a post from a php file when it has something from the database.
this is the js script that sends the post request (im using jquery and the smartupdater plugin)
function update(){
$(document).ready(function(){
$("#myp").smartupdater({
url:"listen.php",
type: POST
minTimeout:2000
},function(data){
$("#myp").before(data);
};
});
return false;
};
and my php file:
<?php
include_once("connect.php");
$date=date();
while($date=>$ddate)
{
usleap(10000);
clearstatcache();
$search=mysql_query("SELECT * FROM chat ORDER BY date DESC LIMIT 1");
$row=mysql_fetch_assoc($search);
$ddate=$row['date'];
}
echo $row['message'] . "<br/>";
?>
i dont know whats wrong, am i doing the whole thing wrong?