<?php 
@session_start();
include('../inc/conn.php');
include('../inc/function.php');
$username=$_GET['user'];
   $startcounts=$_SESSION["mycounts"];
   
   $count=sql_select("select count(*) from chat_message where username='".$username."'");
    
	if($count[0][0]>$startcounts){
	    $sql="select * from chat_message where username='".$username."' order by id desc";
	    $result=mysql_query($sql);
        $rs=mysql_fetch_array($result);
        echo "<div style='height:83px;width:100%;'>".utf8Substr($rs['message'],0,80)."</div>";
		echo "<span style='float:right; color:#0000FF;'>来自：".$rs['guestmail']."</span><br>";
		$_SESSION["mycounts"]=$count[0][0];
	}else{
	   echo "none";
	}
   
   
   
   
?>